Often, a lot of people invent similar things at the same time. For example, there were several different types of TVs that were invented around the world all at once. Sometimes this happens because one invention is really cool, and a bunch of people set out to try to make a better one. That's what happened with trains: after the first train was invented, everyone rushed to try to make better ones that could go faster and farther.
One of the things engineers do is test their inventions. With trains, there was a big contest in England to try to find the best train engine. Watch this to learn more about it: