Authorities are investigating how Mr Lagaaia, a signal mechanic, was killed by a Blue Mountains service in the course of completing “important maintenance work”.
Rail, Train and Bus union national secretary Bob Nanva said workers were “shattered” after the accident.
“Many of our members are hurting today,” he said. “They have lost a colleague and a mate in very tragic circumstances.
“The workers who witnessed the incident, and the driver of the train, are all doing it very tough.”
Sydney Trains chief executive Howard Collins said the incident would be “fully investigated”.
“Sydney Trains is working with authorities at the scene to determine the cause of this incident,” Mr Collins said.
“The safety of our workers is our top priority and this incident will be fully investigated by the relevant independent authorities.”
NSW Police attended the scene of the accident and will prepare a report for the coroner, however a police spokeswoman said the death was “not suspicious”.
Mr Lagaaia’s friends and family paid tribute to him on social media.
“May the Good Lord wrap his arms around your family [and] comfort them through all that’s ahead,” Rosita Duffy wrote on Facebook.
One relative, Gloria Lagaaia, wrote “fly high uncle”.
“Now your taken away from us so suddenly … but without a doubt families are forever Uncle,” she wrote.
Mr Nanva said the union sent its condolences to Mr Lagaaia’s family.
“All workers have the right to go home safely after a shift,” he said.
Transport Minister Andrew Constance released a statement saying transport authorities would “work tirelessly with the relevant agencies during the investigation”.
“I am shocked and saddened by this news,” he said.