Strangely enough, he ended up passing the exam.

Literal

Strangely [also-にも] he [topic-は] in-the-end that exam [at-に] passed.

不思議にも = 'strangely enough.' 結局 = 'in the end / ultimately.' 合格した = 'passed.' にも after 不思議 adds emphasis: 'of all things, strangely.'