The vehicles collided around 4.40am between Immensee and Arth-Goldau in the canton of Schwyz, cantonal police said.
A 54-year-old German man died in the collision,while a 51-year-old Portuguese man was taken to hospital for treatment of seriously injuries, police said.
Other workers on the site escaped injury.
The trains in the crash reportedly belonged to a private company hired to carry out track maintenance.
Swiss Federal Railways (SBB) said one of the trains had rear-ended the other, which was at a standstill.
The extent of the damage was not immediately known, a spokesman for SBB was quoted as saying by the ATS news agency.
The closure of the rail line led to cancellation of various trains, with buses pressed into service to link passengers from central Switzerland with Ticino.
Passengers from Lausanne, Bern and Basel heading to Lugano or Milan were rerouted via Zurich, ATS said.