SID, Serbia — Two formerly warring nations, Serbia and Croatia, have forged a rare agreement to improve the journey of migrants in Europe, providing train service across their borders to ease travel through the West Balkans, a route known for its bottlenecks, chaos and misery.

The first train service transporting migrants directly from Serbia into Croatia began on Tuesday, allowing men, women and children to bypass an isolated border crossing where migrants frequently had been stalled.

The arrangement was part of an agreement between the two nations that would have been unthinkable in their recent past. The train journey began fewer than five miles from the spot where the first fighting broke out in Yugoslavia in 1991 between Serbs and Croats, eventually escalating into war and resulting in the loss of more than 100,000 lives.

In the absence of an effective plan by the 28-nation European Union, the arrangement was also an unusual effort by European countries to work together, officially and publicly, to address a humanitarian crisis that continues to deepen, with thousands still arriving every day even as temperatures drop.