Mayor of London Sadiq Khan's decision to introduce the congestion charge for minicab drivers is not unlawfully discriminatory, the High Court has ruled.
The Independent Workers' Union of Great Britain (IWGB) has said it intends to appeal the ruling.
The union claimed removing minicabs' exemption from the £11.50 daily fee indirectly discriminates against a 94% black and minority ethnic (BAME) workforce.
The union argued Mr Khan's decision, which came into effect in April, disproportionately affects BAME drivers, while drivers of London's traditional black cabs - 88% of whom are white - remain exempt from the charge.
IWGB also claimed the decision disproportionately affects women, who are more likely to work part-time, and disabled passengers, whom they claim will be adversely affected by a reduction in the number of available minicabs.
But, giving judgment in London on Wednesday, Mr Justice Lewis dismissed IWGB's claim.
The judge said the decision was "a proportionate means of achieving a legitimate aim, namely the reduction of traffic and congestion within the congestion charge zone without reducing the number of designated wheelchair-accessible vehicles".
He added: "The aim that the defendant sought to pursue, namely achieving a reduction in the number of private hire vehicles in the congestion charge zone, is a legitimate one adopted as a measure of economic, social and environmental policy."
He added: "There are no other less-intrusive measures which could realistically achieve the same aim."
Following the ruling on Wednesday, IWGB general secretary Jason Moyer-Lee confirmed the union would pursue an appeal against the ruling, saying: "The IWGB is not about to give up at the first set-back."
He added: "The judge, defendant Sadiq Khan, and we all agreed that this charge is bad for ethnic minority and female drivers.
"The question is whether or not the mayor can legally justify it by showing it's reasonable and there were no better alternative measures to reduce congestion.
"He hasn't done this and the judge adopted the incorrect legal test when assessing the matter. So now we take the fight to the Court of Appeal."
In a statement after the ruling, a Mayor of London spokeswoman said: "We are pleased with the judge's decision.
"Removing the congestion charge exemption for private hire vehicles, apart from those that are wheelchair-accessible, is an important part of our plans both to reduce traffic volumes and congestion in London, with the additional benefits of reduced air pollution."