The vote fulfils a promise by new PM Péter Magyar to stop his predecessor from becoming prime minister again.