“The Vienna police do not have the manpower to deal with a crowd of this size,” he said, so the disembarking passengers were essentially free to go where they wished. “They could scatter to the winds,” he said.

The Viennese who assembled to greet the newcomers brought shopping carts and boxes full of bottled water, bread, diapers, cookies, fruit and candy.

“They have been traveling so long and must be very hungry and they have been treated so shabbily,” said Marlene Pramhas, a social worker. She and two friends brought as many loaves of bread as they could carry to the train station, where “it is more or less chaos,” she said.

“We felt we had to do something,” Ms. Pramhas said. “It’s a small thing but maybe it will help.”

When the doors of one train from Budapest opened, a stream of people poured off, many clutching bags of clothing and other possessions. There were children screaming as cameras flashed and several people on the station platform waved and called out, “Hi! Welcome!”