HI Andy,
If as per the law it mandates the company to drop female employees then I think you should be following practice in order to be away from any legal proceedings in the said scenario -
1. If the female is to use her personal mode of transport -
She should give in writing that she does not need company's transportation and would manage on her own. The shift timing be mentioned so that it is understood from it that inspite of odd shift hours, she is willingly agreed to use her own means of transport.
Say for example a firm has a couple or a female staff working with her brother or cousin, she might prefer to go back with her husband/fiancee or her brother/cousin than relying on company's transport as well.
Whatever the reason is her personal choice but company should not be held liable if the female is willingly option out of transport service.
2. If on a particular day she is not to use company's transport.
In such case as well the female should give in writing that for said day she would not be using company's transport as she shall be picked up by XYZ. She agrees that in such case, company is not liable for her safety as they cannot track her safety.
However, for any mishaps, you can also ask the female to note down contact no and/or address of the person who is to pick up, her relation with the said person and mode of transport.
Seniors can also suggest some ways in such scenario when actually company has no fault but if some mishap happens, what should be done.