The outcome was a victory for the Republican president, who has complained about individual judges throwing up obstacles to his agenda.