USA certainly used to have quite extensive long distance passenger services which were jointly run by two or even three companies end to end. The classic streamliners from Chicago to San Francisco for example had two different, competing routes, each of which needed three companies involved. The rolling stock was typically all in a common livery and build, but look closely and you would see different ownership plates, even within the same train. Some crew, and the locomotives, worked right through, others changed at the railway boundaries. One of the companies was generally in the lead for organising it all. On the C&NW-Union Pacific-Southern Pacific "City of San Francisco" the Union Pacific did overall organisation, while on the Burlington-Rio Grande-Western Pacific "California Zephyr" the Burlington called the shots. All this went when Amtrak came along.
Nowadays in the USA on freight it is common for locomotives to "run through", to a considerable extent, and it is normal to see locos from different companies in the same train. Careful note is taken of how many miles each runs, and from time to time locos will just be loaned from one company to another, to "work off mileage", to keep the accounting in balance.