The expansion of the railroads in the late 1800s was instrumental in helping the US economy boom. It did this in two ways.
First, the railroads created a tremendous amount of demand for goods and labor on their own. As the railroads were being built, they needed huge numbers of people to build them. They also, of course, needed enormous quantities of steel for rails and rolling stock and wood for things like railroad ties. This demand, particularly for steel, helped the US economy to boom.
Second, the railroads created a huge national market. Before the expansion of railroads, it had been very hard to get goods from place to place on land. Moreover, the whole western United States was essentially worthless to the national economy because goods could not be easily transported from there to the rest of the US (particularly because there was no Panama Canal in those days). The railroads tied the whole US together. Now, crops and cattle from the West could become part of the economy as could the things produced by mines in the West. Now, anything could be transported anywhere in the country. This allowed companies to become much bigger and allowed the economy to boom.
In these ways, the railroad expansion allowed the US economy to expand rapidly in the late 1800s.