Lots of well meaning advice here but nothing very practical.
Get custody - how exactly does he do that?
Get Social Service involved - is there a risk the daughter could end up in care?
Send her to boarding school - don't. Really, don't.
There are too many things we don't know to be of any real help. Is there anything in Dick's background, on record, that could jeopardise his chances of getting custody?
Is there a risk ex wife could flee to Thailand taking daughter with her? If so, how does Dick make sure that doesn't happen?
Is there anything in ex-wife's background, on record, that could help Dick to get custody?
Who should he go to for professional advice re custody?
Is the daughter simply playing one parent against the other? It does happen, even with very young children.
Looking at Dick's opening post calmly:
the police and social services have been told by Dick that his wife is leaving young daughter alone for many hours each day. She has not been removed, so is it actually true?
he didn't see daughter roaming the street, he was told by an older boy - was she?
swearing in front of a child is horrid and shouldn't happen, but as already pointed out, maybe ex wife only does that within Dick's hearing because of the animosity between them.
Dick, if you know when she is home alone you really should fetch her. That is the most important thing you can do for now.