The government has lost its case against a group of judges, who claimed its latest rounds of pension cuts were discriminatory.