Earlier this month, the Victorian Supreme Court found the state government had breached the teenagers' human rights by relocating them to Barwon Prison, and declared their placement there unlawful.
The detainees were transferred to the maximum-security adult jail outside Geelong from the Melbourne Youth Justice Centre in November when, the government says, riots caused considerable damage to the facility.
The Court of Appeal has now dismissed the state's application to challenge the Supreme Court ruling, meaning the young inmates must be immediately relocated.
Hugh de Kretser from the Human Rights Law Centre - which together with the Fitzroy Legal Service represented the detainees - says Barwon prison is unfit for children.
"The children were held in cruel conditions in Barwon. The Supreme Court heard evidence of extended periods of solitary confinement, the use of guard dogs in the unit, threats of tear gas, limited access to family, handcuffs on the children to-and-from the outdoor area, extremely limited time outdoors, and denial of access to proper schooling."
The Supreme Court granted a stay on its initial decision because the government said it had no other safe location to move the teenagers to.
But Hugh de Kretser believes there were other facilities that could take them.
"The government needs to abandon its plans to use Barwon as a facility for children in the future. Children do not belong in an adult jail."
"Where should they go?"
"They need to be housed in safe, lawful and appropriate conditions. So, there is available space in the current lawful youth justice facilities in Victoria. That's where they need to be held."
Victoria's Youth Affairs Minister, Jenny Mikakos, says the alternative was to place them in crowded conditions or in isolation rooms and without the facilities provided as part of a dedicated wing at Barwon Prison.
She says the government plans to explore the options available to it under the relevant legislation, and that the Court of Appeal's ruling wasn't entirely unfavourable.
"The Court of Appeal did find that there was no improper purpose in the government gazetting the Grevillea unit of Barwon Prison to be used as a youth justice centre. We need to remember the context in which this was done. Right from the outset, if you look at what I said in the parliament, I explained that we lost 60 beds at the Parkville youth justice facility. Now, that constitutes a very significant impact in terms of our youth justice system. We did lose significant operational capacity by virtue of having 60 beds effectively trashed by those young offenders."
The opposition's spokeswoman for families and children, Georgie Crozier, says the outcome shows the state government wasn't properly prepared for the legal challenge.
"The chaos in youth justice facilities, the youth justice system, has been played out for months. And this just demonstrates a botched and rushed decision by the Premier (Daniel Andrews) and his Minister Jenny Mikakos."
The Victorian government has until 4.30pm on Friday, Dec 30, to comply with the ruling from the Court of Appeal.
Around 12 juvenile detainees are said to still be at Barwon Prison.