The first and primary concern is with the father. If the mother goes to jail then the father has first right to take custody of the children. In the event that he doesn't want the children then the step father can request custody because he has stood in the role of a parent. Her family can ask for custody as well. It depends on a lot of factors such as how long the children have lived with the step father, how long they lived with the other family members, how long they have been here, etc. If the children haven't lived here for at least 6 months then there is an issue with subject matter jurisdiction. I would need more information to really address this question. If mom has a little time you may be able to file a Complaint with her and the father has Defendants. If both parents agreed to give you at least Temporary Custody then you could probably do it by consent. Even with this there are constitutional issues that may come back to hurt the mother later. You really need to sit down with a family law attorney and have a thorough consultation.
Sign up to receive a 5-part series of useful information and advice about child custody law.