What was ruled to be unlawful was the indefinite detention of children who crossed the border with a guardian.
What do you mean by "indefinite detention"? If I were responsible for a border, and a child crossed said border, I can either "indefinitely detain" the child, or I can just let him keep walking. Or maybe I can stop him, ask his name, and then send him on his way.

The options when faced with a unaccomponied child are...
indefinitely detain - that is, detain the child until a suitable alternative has been found,
send them back - dump them the other side of the border and it's Mexico's problem again,
process them and don't detain them - leave a child to fend for himself in USA

When children turn up at borders alone, they need to be cared for. That is detention, and it's indefinite because they are alone, a child, and it would be grossly irresponsible if the receiving state did NOT dteain them.

For fuck's sake.