Perhaps, an indepenent study by the Ministry of Railways could get many more details on how their services are utilised by these marginalised people and there is clearly a way to stop all this by properly rehabilitating this class.
One option could be that the Railways requests the help of many other corporate bodies to sort this issue out with a human face - services of experts need to be solicited to find out as to how best they can be rehabilitated.