Legal challenge on retiree benefits loses first round in court