The inmates, Tagaloasa Filipaina and Ovaleni Poli Palau, were transferred from Tafaigata prison to the Apia police station in February 2018.
The pair had been suspected of planning a mass prison break out during a cyclone warning last February.
In her ruling, Justice Tafaiomalo Tuala Warren, said there was no breach of the applicant's constitutional rights.
She also encouraged the Commissioner of Prisons and Corrections to reassess the viability of taking the applicants to the newly built prison at Tanumalala, which is expected to be opened by July.