To solve:
One is to move the railway, which is more difficult.
Second, moving the factory is less difficult.
If these two methods can't be done, as long as no one lives in the factory.
It doesn't matter.