This teaching involves the authority of Jesus versus the (presumed) authority of Hebrew scriptures regarding doing work on the Sabbath. Jesus was working on the Sabbath and the Hebrews were condemning him because of it since by a technical reading of the Torah, doing work on the Sabbath is forbidden.
Earlier in the chapter Jesus says:
You study the Scriptures diligently because you think that in them you have eternal life. These are the very Scriptures that testify about me, yet you refuse to come to me to have life. (John 5:39 NIV)
So, in other words, what Jesus is saying is that the Hebrews are tendentiously reading the scriptures to condemn His actions, but in fact regardless of what the scriptures might say his teaching overrides it because He carries the Holy Spirit in what he does and since Moses prophesized His coming, he has the authority of Moses when he overrides what the scriptures say literally.
Thus, when the Hebrews condemn Jesus according to their pedantic reading of the Torah, they are (Jesus claims) essentially defying Moses himself and since Moses was the original bringer of the Torah, his authority presupposes it. The upshot is that by relying on the words of Moses as opposed to his divine intent, the Hebrews are losing the eternal life they seek which Jesus offers ("whoever hears my word and believes him who sent me has eternal life").
In other words, the Hebrews are vainly seeking eternal life in the words of the scriptures, instead of seeking eternal life from the Holy Spirit which is brought by Jesus, and when the final judgment comes it is the authority of Moses himself that will condemn them.
It is not necessary to read the passage literally and suppose that the ghost of Moses will be present at Doomsday, because when Jesus says "Moses will condemn you" it can just as well mean that the original intent of Moses as known by God will be enough to do that.