Retained firefighters lose battle for pension rights