My heart goes out to you in your situation. You are truly in the sandwich space of trying to meet the needs of both your daughter and your mother. Yet I am not sure how having her go to your ex-husband will help. Right now your daughter has the advantage of having two caregivers under the same roof, and you get to see her and connect with her on a regular basis. Will your ex-husband be able to provide the kind of consistent care and attention that you and your mother give? Will you still be able to see her consistently? These are the questions you need to ask. At 5 she is very likely to need her mother’s presence as often as possible.
It seems like time and money are the real issues so before I would make any radical changes in her living arrangements I would look at resources to help with these factors. You may want to talk to your local women’s center (there is one in your city as there is in most) and explain your situation. They may be able to help with grants to help pay for school, support services for your mother and you, and vocational guidance. While your situation is very stressful it is important to realize that others have had to cope with this struggle and there may be resources available to you that you can use to help your situation. Finally, I would talk to your university about your needs. Most universities have financial assistance for returning students and counseling services free of charge.