Ruling against frontrunner comes despite US call for country to respect voters’ wishes