President Donald Trump’s attempts to deploy the military in Democratic-led cities has brought a head-spinning array of court challenges and overlapping rulings.