Both are correct, but with different meanings. "He hopes to pass the exam" means he wishes / wants to. "He expects to pass the exam" means he is confident that he will pass.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.