Network Rail Infrastructure is set to complete the sale of its specialist plant and equipment division this week.
NDS-Plant will be taken over by a management buyout team trading as TXM Plant.
NDS was formed in November 2011 when Network Rail rescued the rail division of Hydrex Equipment (UK) from its administrators.
The deal secured hundreds of jobs but Network Rail has been looking to offload the firm since the start of this year.
TXM Plant was registered as a company last month and the deal will secure the future of 377 jobs.
Martin Elwood, Director of Network Rail’s National Delivery Service, said: “The successful sale of the NDS-Plant business will enable Network Rail Infrastructure Ltd to safeguard hundreds of jobs and will allow essential rail maintenance, enhancement and renewal programmes across the rail network to continue without disruption.”