My writing often says that my inner socialist and my inner libertarian are perpetually at war - and that's true. If you haven't read about my political leanings then you can find them here. https://medium.com/lucid-nightmare/the-penguin-political-compass-is-complicated-and-controversial-dc04f4267b96
It sounds like your daughter has excellent boundaries and that was a failure of the state to make a choice that's best for the children over the long term. Over here we have the Children Act (1989) which states the welfare of the child is paramount and that guides all the decisions. In this instance I would be advocating for the children to go back (because that's what they want) but I would hope the social workers could make a better case to keep them in the care system and monitored. I don't know what the US legislation underpinning your guidance is - so i don't know what the judge was basing the decision on. Advocacy is about balance - because sometimes children want things that aren't necessarily the best for them.