Because railroads cost less to build and trains provided faster transport.
Since it's faster and cheaper, a lot of companies prefers to use railroads as a medium to distribute their products to the market rather than using canals and steamboats.
Due to its massive success, Railroad companies managed to collect enough capital to spread the railroad networks to more areas all across the country. This cause transportation vehicles such as steamboats and horses started to become obsolete.