Words do evolve. That’s why I said Profession Engineer rather than just engineer. It's a relatively new title (from early 1900's) and in lots of jurisdictions it implies the person is licensed and if something they stamp fails, they can be sued for malpractice and even lose their license to practice.
What does operating locomotives have to do with making sure the thing you're building follows all the rules and has appropriate safety factors and such?
Operating trains is literally the origin of "engineer". It was a job that required significant application of accepted rules and methods to calculate acceptable speeds for cornering, hill climbing, and hill descent, especially when they were all combined. Getting outside the acceptable speed ranges could be catastrophic in every single one of those cases, and acceptable speeds could vary significantly depending on weather, train length, and train weight. The job was all about understanding how to correctly apply all the rules and control the vehicle to stay within safety factors.
There were probably earlier usages of the term too. As the article says the Civil bit came about to distinguish themselves from the older profession of Military Engineers.
Few people who call themselves (non-software) engineers today are running locomotives. Words can evolve over time.