Andrew Gillon, 46, and Leslie Moohan, 31, argued rules barring them from taking part in the poll breached their human rights.
But after just a day's hearing in London examining legal arguments, judges at the UK Supreme Court disagreed. The details of their judgement will be made public later.
The bid by the inmates, neither of whom was at yesterday's hearing, had already been dismissed by judges in Scotland.
Gillon and Moohan were both sentenced to life in prison with the terms imposed in 1998 and 2008 respectively.
The former was jailed for the killing of Gary Johnstone, 25, who was battered on the head with a spade in Bathgate, West Lothian.
The latter was ordered to serve a minimum of 15 years after murdering father-of-two David Redpath, from Peterhead, at a hostel in Edinburgh.
Gillon will be eligible for release later this year while Moohan cannot be freed until 2023.
The decision by the panel of seven Supreme Court justices, including Court President Lord Neuberger and his deputy Lady Hale, has removed the threat of a major controversy hanging over the referendum.
A decision in Moohan and Gillon's favour could have led to thousands of Scottish prisoners being able to vote in September.
It would have also piled pressure on the UK Government to grant prisoners the vote at the 2015 General Election.
The Supreme Court analysed provisions contained in the 2013 Scottish Independence Referendum (Franchise) Act and considered whether or not a ban on prisoner voting was a breach of the common-law right to vote or was incompatible with the European Convention on Human Rights. Lawyers for the men argued it was both but, after considering the legal arguments, the judges did not agree.
The prisoners had appealed to the UK Supreme Court after their claims had been dismissed in Scotland by the Outer House and Inner House of the Court of Session.
The blanket ban on prisoner voting in the referendum was introduced by the Scottish Government when it drew up the franchise. It specifically states offenders in prison are not to be entitled to vote.
In December, a joint committee of MPs and peers recommended the Liberal Democrat-Conservative Coalition should adhere to repeated European court rulings and give Britons serving less than a year in jail the right to vote, or risk severe damage to Britain's international reputation.
It is thought such a move would enable around 7000 inmates the right to vote in elections.
But David Cameron and his Conservative colleagues have resisted the demands. The Prime Minister famously said the idea of prisoners being able to vote made him "physically ill".
In February Chris Grayling, the Justice Secretary, issued a brief response to the joint committee's report, saying the UK Government accepted the issues needed to be thought through and were under "active consideration" but it has yet to give a full response and did not include a Bill in May's Queen's Speech.
Last night, Margaret Mitchell, the Scottish Conservative justice spokeswoman, welcomed the UK Supreme Court decision, saying: "This appeal, had it been successful, would have had disastrous consequences, not least for the proposed - referendum in 2017. We remain resolute in our opposition to granting the vote to prisoners. Voting is a basic human right and it is completely correct you forfeit this right when you commit a crime and are sent to prison."