My point is, railroads turned into a real thing. The demand was real and the general large-scale investment was justified.

Just because some companies made bad decisions doesn't mean the railroad industry as a whole was some kind of mirage or mistake. Laying down tracks for trains and passengers that didn't exist yet is still necessary.