WASHINGTON — In September, Labor Secretary Martin J. Walsh spent 20 straight hours helping avoid a strike by freight rail workers, though his relief was tempered because it still needed approval by the rank and file of a dozen unions.
“I talked to the unions and they were like, ‘We hope we can sell this to our members,’ " Walsh recalled of the hints of trouble from union presidents at the end of marathon sessions fueled by Italian takeout at Labor Department headquarters. “So I kind of knew there’s going to be some issues here.”
Sure enough, after a couple unions voted in favor of the agreement, Walsh got a call from the head of another one telling him that its members had rejected it. Three more unions would vote down the deal this fall, putting the nation on a fast track to a national strike with the potential to devastate the economy in the middle of the holiday shopping season.
Moments like this are why President Biden chose Walsh for the job. A union man deep in his bones, the former Boston mayor has been in the middle of the administration’s scramble to keep the trains running, while also trying to retain the support of organized labor that is crucial to Biden and the Democratic Party.
Walsh was a pivotal presence in the complex efforts that began in the summer and culminated Friday, with Biden signing legislation rushed through Congress that imposes the agreement on the four rail unions that rejected it because of a lack of paid sick leave. As the strike loomed on Dec. 9, Walsh was in frequent contact with union leaders, then trekked to Capitol Hill Thursday with Transportation Secretary Pete Buttigieg to urge Senate Democrats to quickly approve the measure.
“Marty’s working hard on this. He’s a good person to be in this spot,” Senator Elizabeth Warren, a Massachusetts Democrat, said last week. “He’s got the confidence of labor and the confidence of the president.”
Walsh was at the White House on Friday, standing with hands folded at Biden’s side as he talked about the economic importance of avoiding the strike and the disappointment the legislation didn’t include seven paid sick days for workers after the Senate voted down a House provision to add them to the agreement.
“Let me begin by thanking my team here,” Biden said, motioning to Walsh, Buttigieg, and three other administration officials who participated in the effort. “They did one heck of a job averting what could have been a real disaster and ended up with a good product, but we still have more work to do in my view in terms of ultimately getting paid sick leave, not just for rail workers but for every worker in America.”
Despite the disappointment and anger from some rail workers and labor advocates — including about 200 who protested the deal outside an appearance by Biden in Boston Friday — Walsh said the end result still represented a victory for unions.
“It’s definitely a win because when we first got involved in this, this contract wasn’t going anywhere,” he said in an interview. He noted that the five-year deal, retroactive to 2020, includes a total pay raise of 24 percent and improved health care benefits.
But Walsh has work to do to smooth over relations with organized labor after forcing a deal on union members who had voted to reject it.
“It’s a bad look for a Democratic administration and a president who says he wants to be the most pro-union president in US history to be siding with these multibillion corporations on this particular issue,” said John Logan, a professor of labor and employment studies at San Francisco State University.
Known as “Union Joe,” Biden tried to demonstrate his strong support for organized labor by picking Walsh as labor secretary despite pressure for a more diverse choice. Walsh has often said his parents, who emigrated from Ireland, rose into the middle class because of the laborers union his father joined. Walsh joined the same union at 21 years old and rose to become its president. He’s the first former union leader to serve as labor secretary since 1977.
“Marty Walsh is a union guy. Everybody knows that. He’s been a pipeline of communication to the administration and into the White House for us,” said Michael S. Baldwin, president of the Brotherhood of Railroad Signalmen, one of the four unions that voted down the September agreement. “His message all along has been that he would always stand with workers and that in the end he’s going to stand with labor.”
But as Walsh’s fears about the deal were being realized and workers in the four unions rejected the agreement, he began publicly warning that Congress might need to step in to prevent a strike. Those four unions represent about half of the 100,000 freight rail workers, while the others planned to honor the picket lines against companies such as CSX, BNSF Railway, and Union Pacific.
The dispute centers on the lack of paid sick time for most freight rail employees for short-term absences. They can use vacation time but have to schedule it in advance, which is difficult. The problem gained attention in June when Aaron Hiles, 51, a BNSF locomotive engineer, died of a heart attack on a train after his family said he canceled a doctor’s appointment after being called in to work under the company’s strict attendance system.
As the strike date approached, Biden decided to ask Congress to force acceptance of the agreement through the Railway Labor Act, a nearly century-old law that allows the federal government to intervene to keep vital commerce flowing.
“It’s not an easy call, but I think we have to do it,” Biden said before a meeting with congressional leaders on Tuesday. “The economy is at risk.”
Walsh acknowledged he was disappointed it came to that.
“The best way to get this done is at the bargaining table,” he said in the interview.
The House voted 290-137 on Wednesday to impose the agreement on the unions, with 79 Republicans joining most Democrats. A second bill to add the seven days of paid sick leave narrowly squeaked through by a 221-207 vote.
The challenge then was to get the Senate to act quickly, with 60 votes needed to pass the measures, as the strike date approached. With the timing of a vote uncertain, Walsh and Buttigieg arrived at the Capitol Thursday afternoon to make the administration’s case.
“We’ll see what the Senate does,” Walsh said then as he hustled out of the building after the closed-door lunch. “I’m hopeful. I think it’s important for the American economy.”
The Senate voted 80-15 shortly afterward to avert a strike. But the separate measure adding paid sick days fell eight votes short.
Rail union leaders and workers were upset the sick leave was not included. They included Nick Wurst, 26, a CSX freight train conductor who works out of Framingham and helped organize the Boston protest. He said that Biden and members of Congress took away the fundamental right to strike.
“I never expected anything from Biden. From my perspective, he’s corporate through and through, and so’s his party,” said Wurst, a member of SMART Transportation Division Local 1473, one of the unions that voted down the deal. “Just because you’re expecting something, once it happens, it doesn’t make it feel a whole lot better.”
But Baldwin, head of the Signalmen union, said he does not feel let down by the Biden administration putting the matter in the hands of Congress, and doesn’t think it will hurt the president with organized labor.
“While our members will bark out at Biden or bark out at the union leadership, truthfully their anger is directed at the employers,” Baldwin said.
Walsh’s next job will be to help repair those relations. He’s already started by echoing Biden’s promise to continue pushing on the issue that they fell short on in averting a rail strike.
“I’m going to do everything in my power ... to continue to fight for sick time not [just] for the rail workers but for other workers as well,” Walsh said.
Dana Gerber of the Globe staff contributed to this report.
Jim Puzzanghera can be reached at firstname.lastname@example.org. Follow him @JimPuzzanghera. Jackie Kucinich can be reached at email@example.com. Follow her @JFKucinich and on Instagram at @JackieKucinich.