This is similarly true of aircraft, which are immensely vulnerable to attack, and which typically don't overfly regions of conflict, as well as sea traffic, which is somewhat less vulnerable, but may be subject to closed access to specific routes, usually by way of canals. These differ from rail in that the routes are not typically quite so constrained. But as a general rule, commerce and trade rely on good relations.

In the case of aircraft, there have been a number of shoot-downs of civillian craft. Wikipedia lists at least 39 such incidents here, a starting number since 1980, contrasting to the argument that relations have become increasingly peaceable in recent decades.

https://en.wikipedia.org/wiki/List_of_airliner_shootdown_inc...

One of the more notable instances of ships denied access to a shorter route was the case of the Russian navy's Baltic fleet in the Russo-Japanese war. After the Russian fleet After mistaking a British fishing fleet for Japanese torpedo boats in the North Sea, and sinking them in what is known as the Dogger Bank Incident, Britain denied Russia use of the Suez Canal (by some accounts). The Baltic fleet were forced to go the long way 'round, via the Cape of Good Hope and South Africa, and arrived in very poor condition (having dparted in not much better) and suffered a humilating defeat at the Battle of Tsushima which helped in part precipitate the failed 1905 Russian Revolution.

https://en.m.wikipedia.org/wiki/Battle_of_Tsushima

https://en.wikipedia.org/wiki/Dogger_Bank_incident

https://en.wikipedia.org/wiki/Russo-Japanese_War

The logistical task of moving a coal-fired naval fleet around the world was formidible, with the Baltic fleet requiring forty coaling stops. The round-the-world tour of the US's own Great White Fleet shortly after (1907--9) was in part a tour de force of US claims on fueling and service ports along the route. The emergence of oil and nuclear-powered vessels was transformative to naval power, the former beginning with the British fleet immediately prior to the First World War, the latter during and after the Cold War, though largely limited to aircraft carriers and submarines.

Arguably, whales are another case in which long-distance mobility is enabled by attractive prospects at widely-sepatarted locations (krill and other feeding grounds), and a lack of any credible predators or enemies. The very largest whales are an evolutionarily modern development, having grown from smaller species largely inhabiting coastal waters. The emergence of a capable predator (humans) very nearly proved fatal to all great whale species.

Another transportation mode which existed in the Middle East was the Trans-Arabian pipeline. As with railroads, pipelines rely on safe passage along a land route. Most critically, the TAP crossed the Golan Heights, which came under Israeli control during the 1967 Six Day War.

https://en.wikipedia.org/wiki/Trans-Arabian_Pipeline

And in the US, when highway construction was largely a local affair, wealthier cities and towns tended to ignore routes outside city limits, counties tended to ignore those extending beyond county lines, and states those which extended beyond their own boundaries. One of the benefits of a nationaly highway and interstate system (and there were national post roads and highways before the inauguration of the US Interstate Highway System in 1956) was in creating an overarching interest in a national transportation infrastructure, with commensurate planning and financing.

Even today, there are few boundary marks as evident as where one jurisdiction's highway work ends and another begins, particularly between wealthier and less-flush jurisdictions, be they towns, counties, or states. The demarcation is literally paved on the ground.

https://en.wikipedia.org/wiki/Interstate_Highway_System#Fede...