The Trump administration’s aggressive efforts to enact major elements of its agenda have led to a series of courtroom clashes between increasingly skeptical judges and the beleaguered lawyers responsible for defending the government’s positions, which some have come to see as indefensible.