>>1157858>Because horses' assesThis.
The first rail lines, way before locomotives were invented, were human-drawn and horse-drawn affairs in mines. When you have horses pulling a train car side-by-side, it's roughly 4 ft, 8.5 in (standard gauge). There is an urban legend that George Stephenson, considered the father of modern railways, chose this gauge because that was the width of the wheels on Roman chariots, but there is no hard evidence of that. Most of the time, when early railway designers picked the track gauge, there was no real science behind it. They picked it because it "felt right".
Related fun fact: the booster rockets for the Space Shuttle were built by a company in Utah and to get them to Florida, they had to be transported by rail. One obstacle is a tunnel in Colorado (I believe it's the Moffet Tunnel west of Denver), and the rocket designers had to design the rockets to be small enough to fit. So basically, space travel is being determined by a horse's ass, too.