The case revolves a payment of £650 million made by Iran in the 1970s to buy 1,500 Chieftain tanks from Britain and repair 250 more.
The deal was blocked after the 1979 Islamic Revolution deposed the Western-backed Shah.
Britain kept the paid portion of the contract.
Just under £400 million ($500 million, 450 million euros) are now being kept in a frozen British bank account.
Sending the money to Tehran is further complicated by EU and US sanctions linked to Iran's nuclear programme.
A judge with the UK High Court ruled on Wednesday that Britain did not owe Iran interest payments of more than £20 million that had accumulated on the sum over 10 years.
Justice Stephen Phillips cited a precedent case that found claims made by any "Iranian person, entity or body, including the Iranian government" were invalid in commercial disputes because of the Western sanctions.
The Iranian claim was made jointly by its defence ministry and armed forces.
New UK Prime Minister Boris Johnson said while he was still foreign minister in 2018 that making the payment could help pave the way for the released from a Tehran jail of British-Iranian national Nazanin Zaghari-Ratcliffe.
The 41-year-old's 2016 arrest and conviction on sedition charges she has protested with a series of hunger strikes has further complicated London's historically difficult ties with Tehran.
These were inflamed further by Iran's detention of a British-flagged tanker on July 19 in the Strait of Hormuz.
The seizure came in apparent retaliation for the UK authorities' arrest of an Iranian tanker off Gibraltar on July 4 on suspicion it was shipping oil to Syria in apparent breach of EU sanctions.
Iran has not publicly commented on Wednesday's court ruling.