Perhaps, ownership of the rails, not the railroad companies would go a long way. After all, the government owns the roads, not the trucking companies and seems to work quite well.
By transferring the rails to public ownership, just like the highway system, would allow the private sector as well...