HEGYESHALOM, Hungary — Throughout the day on Sunday, train after packed train arrived at this border town from Budapest, the passengers smoothly shifting to a gleaming Austrian train on the opposite side of the platform and being whisked on to Vienna and beyond — 13,000 of them in the first 36 hours after Hungary allowed throngs of refugees and migrants to travel toward Germany.

But that is not the end. Thousands of migrants continue to flow through the Balkans toward Hungary every day, rapidly approaching its southern border with Serbia, government officials said. Two Greek ferries carrying more than 4,000 migrants were scheduled to land Sunday in Athens, a first stop on the migrant trail through the Balkans.

Despite cheers of welcome in Germany, and tears of relief from weary migrants, it remained unclear how Europe would deal with successive waves of migrants, which humanitarian groups have assured are on the way, perhaps for months or even years, until the wars, poverty and other underlying causes of the dislocations have abated.

On Sunday, Pope Francis called upon Catholic parishes and religious communities to take in refugees. And Germany has called for a quota system to distribute the migrant population evenly throughout Europe.