Peak railroad miles in the USA happened around 1916, but peak railroad probably happened before that. The "rail" bubble expanded during the mid 1800s and burst in 1894 and 25% of railroad miles went into receivership. It's hard to tell exactly when the railroads hit the point of diminishing returns, but it was pretty clear in the 1900s that it was in negative returns territory. The interurban system, for example, in northeast Ohio wasn't profitable. That started in 1900, and several of the companies were bankrupt by the time of WWI.
Peak railroad happened during a time of peak "elite overproduction" which is a concept developed by the historian Peter Turchin. (more detail on his website.) Elite overproduction is a metric that characterizes the excess number of people vying for "elite" slots in society, e.g. 1,000 PhDs in LGBTQ studies vying for 3 jobs per year, or 25,000 new lawyers per year all trying to make millions of dollars a year on 38,000 fatal car crashes. He sees the metric as an indicator of conditions in society that lead to discord.
Lots of economic indicators look good during the periods of "elite overproduction" depicted in the chart, for example, the GDP grew significantly in the Gilded Age (1870-1900) and new technology improved people's capability substantially, e.g. the railroads allowed people to travel more easily, and enabled farmers to expand their markets. However, the new prosperity also created a really top-heavy society compared to prior eras in the form of millionaires, more management and bureaucracy, and more institutional control. I think that's what "elite overproduction" really indicates.
The underlying engine of wealth generation has inherent limits, like the railroads did. They had intrinsic limits, but during the time of growth, nobody knows what those limits are. For example, a speculator might fund the construction of a rail line to nowhere, and a town grows there and the railroad could be profitable, but that might be a rare event.
It makes sense that the peak of railroad corporate activity would happen well into the phase of diminishing and negative returns. That's probably one of the drivers of discord during a time of prosperity. There's an institutional competition for wealth and resources. People as a mass are carrying out projects that have less and less chance of success, and then the corporations start trying to squeeze more wealth from their customers, through consolidation, monopoly, and scams.
It seems like we're in a really similar era. Some metrics look great, but life sucks for a lot of people, and institutions are getting ridiculously top heavy. There are a lot of makework jobs in corporate America that just expand bureaucracy. There are essentially political comissars that work in corporations, now, promoting lefty cultural and political ideas, for example. Corporations are trying to squeeze customers, for example, BMW and Toyota are going to charge customers monthly fees for various vehicle features. There's a scam a minute: cryptocurrencies, various completely fake tech companies and EV companies, etc...
The concepts of the "4th Industrial Revolution" and associated ideas, like "stakeholder capitalism" or ESG are an attempt to grow the tech era elites in perpetuity. In the Gilded Age the US dollar was gold backed. Today, it's debt based. Various federal reserve officials have said there's no limit on the amount of credit/debt they can issue. In their mind the only limit on economic activity is the ability to "plan". Computers seem to provide an avenue for planning ad infinitum. An Internet of Things will provide endless data to feed the computers, etc...
The 4th Industrial Revolution seems like an attempt to avert the diminishing returns problem for the tech industry.