What did Jesus say that caused them to believe in Him? He told them that He was the light of the world. The Pharisees were not able to trip Him up. Then He told them "unless you believe that I am He, you will die in your sins."
Whatever it was that caused them to believe in Him, their belief was shallow. In the next verses, they end up rejecting Him.
It appears to me that they believed that Jesus was the Messiah, but He was not the Messiah that they wanted. I've seen things like this before. They believe until Jesus says something that offends them or they do not understand.