Government plans to run some 300 special trains for migrant workers who have been forced to walk for days to get home.