Shafiq Rasul and Asif Iqbal, from the west Midlands, are among a group of detainees being held at the US naval base in Guantanamo Bay after being captured in Afghanistan.
Lawyers acting for the families of the pair, as well as an Australian man and 11 Kuwaitis, argued that the men should be allowed to put their case to a federal judge.
But US District Court Judge Colleen Kollar-Kotelly, sitting in Washington, ruled the American legal system had no jurisdiction over the detainees.
The legal team acting on behalf of the families are now considering appealing against the decision.
The US Government has refused to treat the detainees as prisoners-of-war.
'Spineless'
The Britons' lawyer Clive Stafford-Smith told BBC Radio 4's Today programme that the American authorities wanted the world to forget about these men.
"That's something we just cannot allow to happen," he said.
The legal action had called on the US Government to allow lawyers access to the men and to bring charges against them, or free them.
Mr Stafford-Smith criticised the UK Government for being "spineless" in its failure to intervene.
"There will come a time, I'm hopeful, when our government will say `enough is enough, send these people back and if they've done something wrong we'll try them in Britain and if they have not we'll let them go'."
"The judge ruled that if you are not an American citizen you have no rights and you can be held forever."
None of the 600 detainees, held at Camp X Ray since last year, have been charged and they have no right to see a lawyer.
Legal status
If they went before a military tribunal a death penalty could be imposed.
Even if the pair were acquitted at a military tribunal, they could still be held indefinitely in Cuba, Mr Stafford-Smith told Today.
However the judge said the men would not be detained indefinitely as global courts and the UN could inquire about where and how long prisoners were being held.
Lawyers for the men had argued they had the same rights as Cuban asylum seekers in the US.
But this was rejected as it was ruled Cuban asylum seekers had a credible fear of political persecution.
The Centre for Constitutional Rights, which also represented the men, said the group were disappointed and considering an appeal.
Legal director Bill Goodman said: "The court has left the petitioners in legal limbo without recourse."
The ruling has also been condemned by British lawyer Stephen Jakobi, director of Fair Trials Abroad.
"We think it's a disgrace to civilised society and the American government that nothing whatsoever has been done to try these people in any form of fair trial".
A Foreign Office spokesman said Britain was "working closely" with the US authorities, who were "developing their thinking" about how these prisoners might be prosecuted.