The case is the latest to challenge a wave of actions by President Trump that brazenly violated legal limits on his power.