The mother’s crimes do not affect the rights of the child.
The rights of the child are enforced by the rule of law. In the United States we now have a smorgasbord legal system where you can pick and choose which laws you wish to obey and which laws you choose to ignore. Texas is making that choice in this regard. Too bad for the illegal woman.
We no longer have laws. We have the personal whim of government officials and judges ( elected and non-elected).