Police and fire unions voiced frustration after a court ruling upheld the city’s right to raise the retirement age