British tax authorities, who brought the court action, said the schemes set up by the Swiss and German banks dating back to 2003 and 2004 were designed to avoid around £135 million (174 million euros, $192 million) in tax.
Under the schemes, bankers were given bonuses in the form of shares in specially created companies rather than cash.
Robert Reed, one of the five senior judges hearing the case, referred to such schemes as "the most sophisticated attempts of the Houdini taxpayer to escape from the manacles of tax".
He added: "In our society, a great deal of intellectual effort is devoted to tax avoidance."
British tax authorities said they would now pursue another £30 million from 27 other companies using similar schemes.
Tax avoidance schemes by major multinational companies in Britain have become highly politically sensitive in recent years.
Last week, Facebook announced it would pay more tax as it switches from declaring advertising revenue in Ireland to Britain, although precise amounts will not be known until 2017.
Prime Minister David Cameron's government has come under pressure over a deal sealed with Google in January in which it will pay £130 million to cover underpayment for a decade after a six-year inquiry by tax authorities.