How to make a passage between trains


In the photo, there’s a passageway between the trains. Since the trains are 2 separate cars, how do i make a passage between the 2 trains as the current one does not work. I tried using rope constraints and more.
Does anyone have a idea?
The passage would have to be able to bend as the train goes through turns

This should work, the first car turns and the second car will follow it thanks to the… like, circle in the middle, I don’t know what these are called but I hope you’ll be able to understand.