That is becoming more difficult as the influx of migrants has swelled from pre-winter levels. One day last month, about 1,000 migrants broke through police barriers at a nearby border crossing from Austria and marched on the highway toward Passau. At another crossing, on a bridge, two migrants became impatient and jumped into a river to swim to Germany. Emergency shelters ran out of space, forcing some newcomers to sleep outside for the first time since the crisis began.

The mayor, a large man with a distinctive Bavarian lilt, is not easily shaken. Passau, Mr. Dupper said, is practiced in crisis management. Built on the banks of three rivers — the Danube, the Ilz and the Inn — the city center floods regularly. Flood levels going back to 1501 have been recorded on the facade of the 14th-century City Hall: In 2013 the water rose more than 13 meters, about 43 feet, to its highest levels in about 500 years. Locals used rubber boats to travel.

“We have had our share of emergencies; we will cope with this one, too,” said Mr. Dupper, a rare Social Democrat in conservative Bavaria. And then, echoing Ms. Merkel’s declaration about the migrant crisis: “We can do this.”

But the human flood passing through the city on their journey has some locals worried.

At the train station one recent evening, Officer Claudia Klöfkorn of the federal police was counting migrants getting off a late train from Vienna. Early last month there were perhaps 1,000 new arrivals per day, she said.

Now the figure is close to 2,000 arriving by train, and an additional 3,000 at various border crossings nearby.

The donated beer tent, where migrants lined up for meals and fingerprinting before being sent on to reception centers across Bavaria and other parts of Germany, had been full for hours. Now the platform was getting crowded, too, and more people kept arriving.