New York City Mayor Zohran Mamdani's bid to slow sale of rent-stabilized properties Thursday ran into trouble with a federal judge, a setback to his housing agenda.