It's sad to say but the truth of the matter is, well you don't know what the truth of the matter is.
All you can do when you are brought into such a situation is to listen attentively. Report it to the proper authorities. The downfall of course is the proper authorities don't always do the right thing, they are overwhelmed. As well the girl may or may not be telling the truth. The situation with the mother,...well that could be a whole can of worms itself. Some parts of the story don't necessarily ring 100% true.
Someone did mention that teens are usually able to make a choice on whom they choose to live with. I for the most part think that rings true.
I also can not imagine that the mother can not access free legal counsel. She needs to do some of the work here herself, it's her child and she needs to be on the phone with the courts asking where she can obtain services to help them.
I am sorry you are in such a situation, because being on the outside looking in, makes it very difficult to know what you are looking at, or how you can proceed.