LVIV, Ukraine — Older men and women and young mothers clutching their children’s hands gingerly made their way down the steep steps of a blue train car on Wednesday afternoon.
Some had been onboard the train for more than 20 hours, traveling from cities and towns near the front line of the war in the east to the relative safety of Lviv, the largest city in western Ukraine, which has been a refuge for thousands of people fleeing strife elsewhere in the country.
The desire to flee has become all the more urgent in recent days as the desperate struggle by Ukraine to hold on to its territory in the eastern Donbas region intensifies, with Ukrainian and Russian soldiers clashing in street battles.
Iryna Ivanova, 35, from a city in the Kramatorsk district in eastern Ukraine, shepherded her two daughters — Svitlana Ivanova, 11, and Diana Ivanova, 4 — toward another train waiting across the platform.
“I was afraid because of the kids. It has been getting worse,” she said, adding that the situation had been scary for her two daughters.
They found seats aboard the second train, which would take them to another Ukrainian city near the border with Slovakia, where Ms. Ivanova planned to reunite with her husband.
Their flight to safety was bittersweet. Ms. Ivanova had to leave her grandmother and brother behind in the eastern city of Pokrovsk in the Donetsk region, which has been under a near-constant barrage of shelling.
“There is a war going on. People are dying over there,” she said.
Some on their evacuation train would quickly board free buses to cities across the border with Poland, while others made their way to shelters in Lviv. The organized evacuations were intended to usher them to safety before it was too late.
Many described holding on as long as they could in their home cities, before making the difficult decision to head west as the war edged to their doorsteps.
Inna Lohinova hauled heavy bags down the station’s stairs, scrambling to find the free buses that would take her family across the border to Poland and then on to Lithuania, where they planned to join friends.
Her three children looked on quietly and wide-eyed, visibly tired as their mother explained the family’s flight from the eastern Donetsk region.
“It started to become too dangerous,” she said, explaining how the shelling of a rail line near her hometown had been the final spur to leave amid fears that she and her children could be stuck. She wanted to get out while that was still an option.
Outside the station, Vasyl Kohut, 34, a local volunteer, pointed the family toward the large blue buses that would take them to Poland.
The buses are no longer packed as they had been in the first weeks of the war, he explained, but five trains filled with people from the east had arrived on Wednesday.
Mr. Kohut said he was increasingly meeting people returning from outside Ukraine whose money had run out and were homesick. They were looking for a way to come home, he added, even if that meant braving war.