"worse than the British building thousands of km of canals when after 20-30 years the rails were dominating transportation."I'm not sure that's a fair analogy. Without the canal network to cheaply transport goods and resources in bulk, it's hard to imagine how Britain could ever have industrialised to the point where building a railway network became possible in the first place!
Besides, railways did not immediately obsolete the canals as you seem to suggest. Some canals were still being built and extended until the early 1900s (70+ years after the railway boom), and the last commercial freight services lasted until as late as 1970 - suggesting it was really motorways that "killed off" commercial canal traffic.
One key point of difference is that (like road freight) pretty much anyone could operate a freight service using canals, where as the railways were in the hands of a few huge corporations. That meant a lot of niche, point-to-point freight was more viable to transport over water than rail.