President Trump's agenda is hitting roadblocks in the courts, setting the stage for a legal battle over executive power.