Firm loses legal aid judicial review