Four of the seven were medical students in the city of Kupiansk and three were working there when Russian forces poured across the border in late February and occupied large swaths of eastern and southern Ukraine.
The group said they were captured at the first checkpoint out of Kupiansk and then taken to Vovchansk, near the border with Russia, where they were held in the factory with around 20 Ukrainians.
"They took our passports, other documents, phones, clothes, and locked us up in a room," said Sharujan Gianeswaran, speaking in Tamil to an Associated Press journalist by phone. "There were also Ukrainian people with us, and they were questioned and sent away in 10 days, 15 days or one month. With us they never spoke, because they could not understand our language."
"Most of the time we could not understand what they told us and we were beaten for that," Gianeswaran said.
It dawned upon the Sri Lankans that the battle lines were shifting only when Russian soldiers ordered them to help load trucks with food and weapons.
As the last trucks raced away, the group asked fruitlessly for their passports and papers back, knowing that to move around without them would be impossible in a country filled with checkpoints.
Russian troops captured several cities and towns in northeastern Ukraine's Kharkiv region early in the war. Ukrainian troops retook the area during a swift counteroffensive earlier this month.
When the Sri Lankans realised the Russians were gone, on September 10, the group left the factory and started walking toward the city of Kharkiv, having no real idea how to get to the regional capital which had remained in Ukrainian hands.
"We walked on that road for two days and were exhausted and hungry. We had no food or money to buy food," Gianeswaran said.
They slept on the side of the road and walked until they reached a river. But with so many bridges in the region destroyed by one side or the other in months of fighting, they could find no way to cross.
Finally, someone noticed their plight, gave them shelter and called for a ride from security forces.
Police said the group was picked up in the Chuhuiv area, about 70km from where they started. They are in Kharkiv now, with no idea of what the future holds. Robert Clive said they are psychologically damaged by their months in captivity.
But the men smiled when asked how they felt when they realized the worst of their ordeal was at an end.
"They (Ukrainians) have given us food and clothing," Gianeswaran said. "We thought we were going to die but we are saved and are being well looked after."