Either the commissioner, or any of the senior commanders, should refused to obey the mayor's order, and force the mayor to fire them.
Problem with the higher ups or even the guys being pelted going against orders, being fired might not be the extent of it. In today's charged atmosphere they could be joining the six in court.