At dueling court hearings, lawyers for the Trump administration defended the deployment of troops in two cities.