Judges tell Justice Secretary Shabana Mahmood they have done nothing wrong by introducing different rules for ethnic minorities