The first National Railway int he US? The US government through an act of congress. It was calle dthe PAcific Railroad and was funded and coordinated through three acts of congress called the Pacific Railroad acts of the mid 1800s
Prior to that attempts at private companies to create railways were disasterous and limited linking on short distances, had numerous safety issues, and due to lack of planning often convoluted and inefficient routes. Which ultimately led to why congress chose to fund the acts in the first place, as there was a strong need for a transcontinental railway and private interests were failing to produce one.