Politicians and bureaucrats are usually circumspect when it comes to the future prospects of state contractors, especially when half a decade or more remains on an existing agreement.

That made it striking when then-Transportation Secretary Stephanie Pollack suggested in 2017 that Keolis, the French company in charge of running the MBTA’s sprawling commuter rail network, though not even halfway through an eight-year contract, was unlikely to earn an extension if the Baker administration had its way.

A few years later, though, the T changed course and kept Keolis in place. Then officials extended the contract again. And now, as the MBTA and the Healey administration prepare to weigh bids for the next lucrative, multiyear commuter rail operation contract, Keolis is still in the mix, tapped last month as one of three finalists in a joint bid with fellow French rail company Alstom.

It’s been a striking turnaround in reputation for a company whose first year in the role was marred by a disastrous winter and scrutiny over its management capabilities. And there may be a fairly straightforward explanation for it.

“Over time, they’ve become a much more competent operator,” said Pete Wilson, senior policy director at the advocacy group Transportation for Massachusetts. “Trains seem to be more on-time, the trains are clean when you ride them, you get a pretty good amount of communication from the engineers and conductors if something has gone awry.”

Former governor Deval Patrick’s administration picked Keolis in 2014 for an eight-year, roughly $2.7 billion contract. The deal, like others before it, outsources operations and management of the dozen commuter rail lines that collectively transport tens of millions of riders per year, though the T itself owns the trains and the tracks.

A good deal of the commuter rail’s dismal performance in the first year was, arguably, outside Keolis’s control. One storm after another slammed into the region in 2015, dumping a record 110 inches of snow that upended virtually every mode of travel.

It was also a different, pre-pandemic era. Most employees stranded by canceled trains and buses wound up missing work altogether, unable to pivot to a remote alternative.

“In 2015, there was no remote work. Most of us had never been on Zoom,” Pollack, who served as transportation secretary from 2015 to 2021, told CommonWealth Beacon. “If you didn’t get to work, you didn’t work. It wasn’t like you went home and turned on the computer.”

But some of Keolis’s issues lingered after the snow and ice melted. Insiders said Keolis in its first few years struggled with staffing, at times failing to have enough operators on the clock to run the full schedule of service laid out in the contract. Fare collection — before the installation of fare gates at North Station and South Station — was at times haphazard.