Actually what happened in the US court here is the US court attempted to intercede while the mother and child were still in US custody and ICE ignored the court until they had successfully removed the mother and child from US custody. As a result the court never got to learn the mothers wishes at all.
> Fair or not, that’s what happens in the US courts.
That's also not actually true. Mothers tend to get custody because both parties are more likely to agree to give them custody (or the father is more likely to cede custody).
If it comes to an actual legal battle, fathers are actually more likely to win custody than mothers.