Mr Justice Mitting, presiding over the case, admitted that the requirement could see 40,000 drivers over three years either fail the test or be deterred from applying for a private hire vehicle licence.

But he said Transport for London had no reasonable alternative to the exam, which lasts two hours, costs would-be drivers £200 and does not apply to black cabs.

Uber said it would appeal against a verdict that the company’s London head, Tom Elvidge, called a “deeply disappointing outcome for tens of thousands of drivers who will lose their livelihoods because they cannot pass an essay writing test”.

“We’ve always supported spoken English skills, but writing an essay has nothing to do with communicating with passengers or getting them safely from A to B,” Elvidge added.

The mayor of London, Sadiq Khan, said: “I’m delighted that the courts have today backed my plans to drive up standards and improve passenger safety in London.

“Drivers being able to speak English and understand information from passengers and licensing requirements is a vital part of ensuring passengers get the high standard of service they need and deserve.

“This could include discussing a better route, talking about a medical condition, or ensuring every driver is fully up to date with new regulations.”

Tom de la Mare QC, who was representing Uber and three drivers – Hungarian national Sandor Balogh, Nikolay Dimitrov from Bulgaria and Imran Khan from Pakistan – had argued that the language requirement would result in 33,000 existing drivers losing their livelihoods.

He also said London would lose up to 70,000 drivers when including those who would be deterred from applying, based on figures from TfL’s own finance department.

Uber claimed the proposals would have a disproportionate impact on drivers from countries where English was not generally spoken and give rise to “indirect discrimination on grounds of race and nationality”.

The company previously succeeded in challenging TfL’s plan to exempt drivers from English-speaking countries on grounds of discrimination.

De la Mare pointed to recent statistics from Trinity College London showing that 45% of private licence applicants are failing the B1 standard of English required by TfL.

A sample English test

One sample question from the test reads: “Write an essay (100-130 words) for your teacher about a festival in a country you know.”

Another reads: “A friend in another town is going to study at your college and wants to know about the college rules. Write a letter to your friend (100-130 words).”

Mitting conceded that a “reasonably cautious view” suggested 40,000 drivers would be at risk of failing to obtain a licence. London currently has about 118,000 private hire licensees.

But he ruled that TfL, which argued that the requirements were vital to ensure passenger safety and raise standards, had the right to impose the test.

While Uber lost the legal battle over English requirements, it won on two separate disputes over drivers’ insurance and the need for a 24-hour call centre.

Mitting found in favour of Uber, which argued that its app-based system meant there was no need for it to operate a call centre to field customer complaints.

But the judge said TfL was entitled to force Uber to set up a 24-hour hotline dedicated to emergency calls.

Uber also successfully argued that its drivers should not be required to hold minicab insurance for periods when they are not working, such as during the school holidays.

Peter Blake, TfL’s director of service operations, said: “The judgment today means that we can ensure that all licensed drivers have the right level of English, which is vital for customer safety.

“The court also recognised the need for passengers to be able to contact the private hire company they’re using should an emergency arise.

“We will reflect on today’s judgment and consider how best to deliver the further improvements we want to see to passenger safety and to standards across the industry.”