A rail network is near to a natural monopoly. You can build overlapping rail networks, but it's complex and interconnecting instead of overlapping would usually offer better transportation outcomes and there's a lot less gauge diversity so interconnection is more likely than overlap.
All that to say, you can't really get market forces on the rails. Rails compete with other modes of transit, but roads and oceans and rivers and air aren't driven by market forces either.
Transit by rail does compete in the market for transit across modes. You can have multiple transportation companies running on the same rails, and have some market forces, but capacity constraints make it difficult to have significant competition.