Semi related: “How big should a railroad track be?” Is actually an extremely complicated question that took a long time for us to figure out. It wasn’t unusual for different states to have different gauges, often requiring that passengers change trains at state lines.
Also, Russia to this day uses its own gauge, because they’re terrified of being invaded via rail from Europe.