Peter Magyar has won Hungary’s election, defeating longtime nationalist leader Viktor Orban.