Oh wow. That's incredible. So legally Passenger Rail has priority, but in practice the freight-corporations bully the passenger lines.
Its a difficult situation, because nominally, the freight-rail operators also own those raillines. So a free-market solution is likely not possible. This is just something that needs to be enforced from the top-down.
A free market solution was never feasible as there are just too many parties and externalities involved. This was always going to be a situation where some type of monopoly would happen at various levels which would likely require some type of regulatory intervention to achieve a Pareto-optimal situation.
There are likely solution to the issue that are not top-down, but this isn’t a situation where free market forces will provide the socially optimal outcome.