Two swift court rulings in New York and Tennessee stall Trump’s agenda, with growing judicial resistance to his enforcement plans.