Officials inspect a commuter train crash involving a sport-utility vehicle that occurred the previous night on Feb. 4 in Valhalla, N.Y. The crash killed six people. (Andrew Burton/Getty Images)

After a string of deadly train crashes, a pair of angry U.S. senators stood in New York’s Grand Central Terminal four months ago to denounce the Federal Railroad Administration as a “lawless agency, a rogue agency,’’ too cozy with the railroads it regulates and more interested in “cutting corners” for them than protecting the public.

Fast-forward to the past two months, when photos of rail cars strewn akimbo beside tracks have rivaled mountains of snow in Boston for play in newspapers and on television.

And the blowback from Congress on the railroad agency’s performance?

Proactive. Responsive. On top of it. Very helpful. Superb.

Those accolades primarily were directed at the new acting head of the FRA, Sarah Feinberg, whose two-month tenure in the job has coincided with an astonishing number of high-profile train wrecks.

Officials inspect the commuter train crash involving an SUV from the previous night on Feb. 4 in Valhalla, N.Y. (Andrew Burton/Getty Images)

●Feb. 3: Six people are killed when a commuter train hits an SUV at a grade crossing in Valhalla, N.Y.

●Feb. 4: Fourteen tank cars carrying ethanol jump the tracks north of Dubuque, Iowa, and three of them burst into flames.

●Feb. 16: Twenty-eight tank cars carrying crude oil derail and catch fire in rural West Virginia.

●Feb. 24: A commuter train derails in Oxnard, Calif., after hitting a tractor-trailer at a grade crossing.

●March 5: Twenty-one tank cars derail and leak crude oil within yards of a tributary of the Mississippi River in rural Illinois.

●March 9: The engine and baggage car of an Amtrak train derail after hitting a tractor-trailer at a grade crossing.

A first glance, Feinberg seems an unlikely choice to replace Joseph C. Szabo, the career railroad man who resigned after five years in the job. She is 37, a former White House operative, onetime spokesman for Facebook’s Mark Zuckerberg and, most recently, chief of staff at the Transportation Department.

Nothing on her résumé says “railroad.”

“Sometimes it’s good to have an outside person,” said Sen. Charles E. Schumer (D-N.Y.), who got a call from Feinberg immediately after the Feb. 3 crash in Valhalla. “She’s smart, she’s a quick study, she knows how to bring people together. I think she’s the right person for the job.”

“Whether she’s had a lifetime experience riding the rails or working on the rails, she knows how to get to the crux of things and move things forward,” said Sen. Joe Manchin III (D-W.Va.), who arrived at the Feb. 16 crash shortly before Feinberg did. “I was very impressed.”

Given the double-barreled blast at Grand Central last October by the Democratic senators from Connecticut — Richard Blumenthal and Chris Murphy — the importance of catering to Congress was not lost on Feinberg. Schumer calls her “hard-nosed” and says he isn’t worried if she ruffles some in an industry who have grown accustomed to a more languid pace of change.

After the Valhalla crash, Feinberg pulled together an FRA team to come up with a better way to address an issue that kills hundreds of people at grade crossings each year.

“We’re at a point where about 95 percent of grade-crossing incidents are due to driver or pedestrian error,” she said. “While I don’t blame the victims, this is a good example of a problem that needs some new thinking and a fresh set of eyes.”

A month later, she called on local law enforcement to show a greater presence at grade crossings and ticket drivers who try to beat the warning lights. Next, the railroad administration says it plans “to employ smarter uses of technology, increase public awareness of grade crossing safety and improve signage.”

“When it comes to the rail industry, that is lightning fast, and it’s really impressive,” said a congressional aide who focuses on transportation. “We’ve seen, time and time again in the rail industry, incidents happen. And it takes years, and sometimes even decades, to get action.”

Grade-crossing deaths, though frequent, pale in comparison with the potential catastrophe that Feinberg says keeps her awake at night.

All of the crude-oil train derailments this year happened miles from the nearest town. But little more than a year ago, a CSX train that included six crude-oil tank cars derailed on a river bridge in the middle of Philadelphia. And an oil-fueled fireball after a derailment in the Canadian town of Lac-Megantic in July 2013 left 47 people dead.

“We’re transporting a highly flammable and volatile crude from the middle of the country, more than 1,000 miles on average, to refineries on the coast,” Feinberg said.

The number of tank-car trains has expanded exponentially since a production boom began in the Bakken region, centered in North Dakota. Seven years ago, 9,500 tank cars of Bakken crude traveled by railroad. Last year, the number was 493,126. In 2013, an additional 290,000 cars transported ethanol.

“Fifty to 60 trains pass through this area every day,” Rep. Cheri Bustos (D-Ill.) said as she visited the spot where 21 tank cars derailed and leaked crude on March 5. “I cannot overstate my sense of urgency in making sure that we keep people safe.”

Like every other member of Congress dealing with a train wreck back home, Bustos said one of the first people she heard from was Feinberg.

“She answered every question I had,” Bustos said. “She was informative, she took her time with me. I feel good about that. Not every agency responds to a crisis like that.”

The FRA is an agency that flies under the radar most of the time, a powerful presence to the railroads it regulates but generally out of the public eye. The Federal Aviation Administration — think drones and airlines — gets attention. So does the National Highway Traffic Safety Administration, with record auto recalls last year and the fight against distracted driving.

But dealing with the hazard of the huge quantities of volatile crude now snaking across the country may thrust the FRA to the fore, particularly if the next exploding derailment occurs in or near a city.

Mindful of the potential for disaster, the White House tasked the Office of Management and Budget and the Transportation Department with figuring out how to safely transport the Bakken crude. At Transportation, that fell to Feinberg, who had just signed on as chief of staff to Secretary Anthony Foxx.

“We found her to be very hands-on, firm but fair, and ready to work with all stakeholders in making fact-based decisions,” said Ed Greenberg of the Association of American Railroads. “She is someone who has quickly recognized the challenges in moving crude oil by rail. And the freight rail industry is ready to work with her and her FRA staff.”

The congressional aide said he sees Feinberg as “sort of the sweet spot” in running the FRA.

“She has a depth of subject-matter knowledge that allows her to speak in a lot of detail and with a lot of expertise on a lot of these issues, but she’s not a career railroad person,” he said, “so she’s also willing to challenge the way things are done and ask questions. And I think that’s the key to that job. She has the knowledge but also the ability to move the needle.”

With six people dead in the Feb. 3 Valhalla crash, Robert Sumwalt, a veteran member of the National Transportation Safety Board, was tossing clothes into a suitcase to head up there near midnight when Feinberg called.

“She called to say, ‘We’re there to support you in any way that we can,’ ” he said. “In launching on over 20 accidents as a board member, I’ve only had one other case where the head of a DOT agency called me to make a statement like that.”

Feinberg surprised him a second time when he reached Valhalla the next day.

“It was cold as the dickens, and she was there,” Sumwalt said. “Not only that, but she crawled into the rail car that was all burned out to get a good look at it.”