"They clearly wanted out of that hole as fast as possible," said Lt. Kurt Tietjen of the Rye Fire Department.
Both men were taken to nearby hospitals, officials said.
The two workers were apparently attempting to repair a leak in the foundation of a home at 15 Bradford Ave. when the collapse occurred, officials said. The homeowner was there at the time of the collapse, Rye Mayor Joe Sack said, and immediately called 911.
"Luckily, we have the best first responders in the world in Rye," Sack said.
The collapse occurred at about 11:15 a.m., officials said. The first victim was pulled from the hole at about 12:20 p.m. and the second at about 12:43 p.m.
The two men had been buried up to their mid-chest, Tietjen said.
"They were on oxygen relatively quick, but in no point were they in respiratory duress," he said.
Rye officials requested assistance from the New Rochelle collapse unit as well as the White Plains and Westchester County technical rescue teams.
Responders from Port Chester and Scarsdale also assisted.
Representatives from OSHA were at the scene Thursday afternoon to determine how to cover the collapsed trench.
Click here to follow Daily Voice Rye and receive free news updates.