The justices rejected an emergency appeal from Democratic-led cities seeking to restore the immigration rule.