Shouldn't the people taking care of her son brought him to visit?
Should anyone be detained for five years for immigration violations--unless there's a profit motive? Shouldn't they either be given a path to legalization or sent home, preferably with their minor children, within a month or two?
That being said, if you look at it from the boy's point of view, he most likely does not remember his mother, certainly does not speak Spanish, and would suffer trauma if suddenly transferred out of the only home he remembers.
The only JUST solution (since the adoption was clearly illegal) would be to arrange for a transition period in which the child is gradually transferred to his mother's custody.