The structure of the regulatory framework for railways is that railways publish public tariffs, which outline the conditions under which traffic is accepted and carried. They publish rates and they publish charges. Some of those charges are for activities or situations where there is an expectation of the traffic being loaded within a certain window. If it doesn't happen, then demurrage fees kick in.
That is all disclosed in the public tariffs, the regulatory framework that railways use to communicate with shippers on what the conditions are. All of that is known up front, ahead of time, using that approach.