The above answer is only partial. The invention of the automobile gave rise to the fuel and petroleum industry which dominates the world economy today. There was no market for gasoline or diesel fuel of any significance prior to its invention. In addition, the production of automobiles created a tremendous demand for rubber, glass, and textiles, all used in the production process. Additionally, the automobile allowed people to live some distance from their work, as they could commute by automobile, and not need to walk or rely on public transportation. This development alone was responsible for the development of the suburb, and gave rise to the boom in home ownership which dominated the country for many years.
The economic significance of the automobile became apparent with the manufacture of the Model T Ford, the first to be mass sold and produced. Henry Ford is credited with a famous statement about the Model T. Folks could have the car in any color they wanted--so long as it was Black.
Both of these industries had a huge impact because they caused the need for both the things themselves (cars and trains), but also for many other things that were related to them. By causing all of these needs, they drove the growth of the economy.
Of course, the economy grew just because of the need for cars and train cars. Those things had to be manufactured and many people were employed in manufacturing them. But there were also many other things that were needed. For the railroads, there was, for example, the need to manufacture the rails and then to build the tracks. With cars, there was the need to build roads and the need for gas stations to service the cars and for motels in which motorists could stay.
In these ways, the cars of the 1920s and the railroads of earlier times both helped to drive the growth of the American economy.