If the workers really are producing "substantially more" value for the economy, they are probably underpaid in the first place, or the specific train line/project is a bad investment (too expensive).
There are edge cases, but in general inhibiting the ability of workers to work (e.g. by making it expensive to get there, or expensive live near enough to the work, fail to allow them to be healthy enough to do the work, make it hard to take care of children while working, restrict access to or quality of education etc) is not good for a society built on work.