Just for illustration
Once one locomotive of the train has exactly 150 solid it will make its way to the refuel station where it gets topped off.
Then it tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
A it is still full it then tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
A it is still full it then tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
A it is still full it then tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
A it is still full it then tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
A it is still full it then tries to depart to the next scheduled station.
It gets interrupted because it has 150 solid fuel and redirected to the refuel station (where it still is).
Then it tries to load fuel.
...
Your interrupt condition is wrong. It should be "if solid fuel is < 50" goto refuel