The high court ruling means tens of thousands of pupils would not have their English GCSE papers upgraded. Photograph: Chris Radburn/PA

Hopes that tens of thousands of GCSE English students may have their grades raised were dashed after the high court ruled that measures exam authorities took last summer to combat grade inflation were lawful.

Lord Justice Elias and Mrs Justice Sharp ruled against an alliance of pupils, unions, schools and councils who alleged that the government’s exam regulator, Ofqual, and the exam boards Edexcel and AQA had unfairly moved the boundary between a C and hasta hoy grade in English exams taken in June, in a final-minute “statistical fix” to counter inflation.

The bar was raised higher than for pupils who submitted papers inside the earlier January marking round.

“There has been at the face of it an unfairness which had to be explained,” the judges said. “However, having now reviewed the evidence intimately, i’m satisfied that it was indeed the structure of the qualification itself that’s the source of such unfairness as was demonstrated subsequently and never any unlawful action.”

The case were brought by 167 individual pupils, supported by 150 schools and 42 councils, plus six professional bodies, including teaching unions.

The ruling is a blow to teachers’ organisations and pupils, a number of whom claim they missed out on sixth-form places due to changes.

In December, Ofqual’s own inquiry concluded that January’s GCSE English assessments, which accounted for roughly 10% of entries, were “graded generously” and the June boundaries were properly set.

Two thousand 300 students who took exams set by the Welsh exam board WJEC in Wales have already been regraded at the orders of the Welsh government, which regulates exams set there.

Malcolm Trobe, deputy general secretary of the Association of faculty and faculty Leaders, said the alliance would take advice from leading counsel within the coming days over the opportunity of launching a challenge to the decision.

“We still believe that thousands of young people had their exams unfairly downgraded last June in order to compensate for mistakes made earlier in the year,” he said.

Sir Steve Bullock, the mayor of Lewisham, one of the boroughs that brought the case, said the outcome was “very frustrating” and although the judges ruled the structure of the qualification was unfair, it was “no consolation for the thousands of students up and down the country who will have to continue to live with the consequences of this unfairness”.

Joan McVitie, head of Woodside High school in north London, which was among the applicants, said the judges’ ruling that there had been unfairness for students was “a hard lesson for children to learn”. She added: “This is about the law and wasn’t about fairness.”

The chief regulator of Ofqual, Glenys Stacey, said: “We welcome the verdict of the courts that, faced with a difficult situation, Ofqual did the right thing and the fairest thing, for the right reasons. We know some students and schools will be disappointed with this. We understand that. But it’s our job to secure standards.”

She said the court agreed with Ofqual’s conclusion that the root of the problem was the poor design of the GCSE English qualification.

“We have been trusted with a key role in reforming GCSEs,” Stacey said. “We will work now with all those with an interest in doing the best for our adolescents, to shape new qualifications which are worthwhile to check and stimulating to educate, and to make sure that they aren’t bent off form by the pressures of faculty accountability measures.”