BROCKTON — Greater Boston has the worst rush-hour traffic in the nation, according to the latest rankings from the transportation data firm Inrix. Even on a good morning, that can slow the 23-mile drive from Brockton into an hour-long crawl up Interstate 93.

But as automotive congestion continues to snarl a fast-growing region, Brockton commuters are switching in greater numbers to public transit, effecting a welcome decrease in carbon emissions and a potential rebirth for their city’s downtown.

While ridership on the state’s Commuter Rail is up systemwide, few stations have seen a bigger surge than the one in downtown Brockton, where passengers can board a train that delivers them to Boston’s South Station in just over 30 minutes. Weekday boardings in downtown Brockton have nearly doubled since 2012, according to the latest data from the Massachusetts Bay Transportation Authority, and planners and developers alike are seeking to parlay new foot traffic into housing and commercial development.

Brockton’s own transit authority has only helped the cause, posting a 22 percent ridership bump over the same period on its Route 12 bus, which terminates at a subway station in Boston’s Dorchester neighborhood.

These gains defy a nationwide decline in transit ridership, often attributed to competition from ride-sharing services like Uber and Lyft, but car-stifling congestion isn’t the only thing propping up Brockton’s passenger numbers: skyrocketing housing prices in Boston’s urban core are also sending transit-dependent residents further and further into the metro area’s hinterlands.

Brockton, a city of about 95,000 people, according to the U.S. Census’s American Community Survey, receives some 750 new residents annually from Boston alone, including Reggie Lamar, 31, who recently arrived in search of cheaper rent. He kept his job at a hospital in downtown Boston.

“I could drive to work if I wanted, but there’s no parking and the gas sucks,” Lamar said. Expenses aside, he prefers public transit so he can catch a bit more sleep on the way to work.

The latest Census data estimates that 15 percent of employed workers living in Brockton — roughly 6,600 people — now commute to Boston for their primary job.

On an average workday, that means nearly 1,300 people board the commuter rail at Brockton’s three stations, and about 2,100 ride the Brockton Area Transit Authority’s bus to Dorchester, according to 2018 data.

Rob May, the city’s director of planning and economic development, sees this growing population of transit-riding workers as a blessing. His so-called “seven-layer dip” has captured the attention of housing developers and policy professionals across the region, lending an appetizing name to the head-spinning combination of growth incentives he’s overlapped to encourage development near the downtown bus hub and Commuter Rail station.

There’s the Smart Growth Zoning Overlay District, the Urban Revitalization Area, the District Improvement Financing Boundary and the Housing Development Incentive Program Area. There are also Opportunity Zones, federal and state historic districts and some census tracts eligible for New Market Tax Credits. Pick any parcel downtown and chances are Brockton can offer some form of local, state or federal support.

“It’s a little more than seven layers but the name stuck,” said May.

In total, the incentives have helped the city permit about 200 residential units spread across six downtown projects, according to May, which supplement another 150 already under construction or recently completed.

“Brockton was really slow to see any reinvestment and then all of a sudden the city has built a tremendous pipeline,” said Ben Forman, director of MassINC’s Gateway Cities Institute, which studies the state’s substantial collection of mid-sized, formerly industrial cities. Brockton has since “leapfrogged” many of the cities it once lagged behind in terms of housing production, according to Forman.

But for all the progress, May said Brockton is still a few years and a handful of vacant lots away from a “walkable, 18-hour downtown.” He and Robert Jenkins, executive director of the Brockton Redevelopment Authority, are working on an “investor’s prospectus” of properties ripe for redevelopment, including a handful of dusty lots lining the commuter rail tracks, one of which served for decades as a “Tent City” for homeless residents.

“We’re promoting the fact that we’re a 30-minute train ride from South Station,” said Jenkins. “I think that’s beginning to catch on with folks.”

But Forman said growth in Brockton remains hampered by a rail system that could be doing more to serve its passengers in the so-called “gateway cities” — defined by the Massachusetts Legislature as communities with populations between 35,000 and 250,000 and median household incomes and rates of educational attainment below the state average.

“The commuter rail’s financial model is not based on serving the urban centers that it runs through,” said Forman.

The burst of trains around 9 a.m. and 5 p.m. are better-suited to white-collar workers populating the suburbs in between, according to Tracey Corley, MassINC’s expert on transit-oriented development. Retail and service workers with later shifts, on the other hand, might have to wait more than two hours for a train during off-peak hours, she said.

Even for a gateway city, commuter rail service is especially infrequent in Brockton, despite the encouraging gains in ridership since 2012. Only 14 inbound trains leave the city each weekday, the lowest of the nine gateway cities with commuter rail access, according to MBTA schedules. What’s worse is that Brockton is home to a larger population of Boston-bound commuters than any of these cities except Lynn or Quincy, according to the most recent Census data.

Frequency isn’t the only issue, added Forman. Constructing affordable housing near Commuter Rail stations won’t help if residents don’t want to pay the fare, he said.

Take the case of Nikki Corbett, who lives in the Brockton-adjacent suburb of Avon. She takes the commuter rail “when it snows,” she said. The rest of the time, Corbett commutes to Boston by bus to save money, even though it can add nearly an hour each way when there’s bad traffic. BAT’s round trip journey to Boston costs adults only $4.50, slightly more than a quarter of the commuter rail’s $16.50 round trip ticket.

“It’s so much cheaper,” said Corbett. “That really makes a difference.”

The Massachusetts Department of Transportation has listened closely to these criticisms, assembling planners, wonks and politicians from across the state to contemplate an overhaul of the commuter rail.

In January, the agency published seven alternatives for the system’s future. In four of these scenarios, service to Brockton and the South Shore changes modestly or not at all. In three, MassDOT has proposed something radical: a “Regional Rail” network that would bring trains to and from Brockton every 15 minutes.

“If you’re running high-frequency service throughout the day, that’s what’s really transformative,” said Ethan Finlan, an analyst studying regional rail for the advocacy group TransitMatters. “That’s what gives people access to jobs and educational opportunities.”

The question is, will the state really get it done?

“This process is still in its relatively early phases, but we do have a concern that the legislative side would settle for the cheapest possible alternative,” said Finlan.

Anticipating the need for advocacy, some legislators have already come out in favor of regional rail, including State Sen. William Brownsberger, who represents parts of Boston and two of its immediate suburbs. In a statement announcing his appointment this month to president pro tempore of the senate, Brownsberger argued that Brockton’s gain is also Boston’s when it comes to improved transit.

“What is emerging now is the possibility that a big upgrade in our regional rail system could help alleviate congestion and housing supply needs while reducing carbon emissions,” he said. “If we could offer frequent, all-day service between the inner core and gateway cities like Brockton, Worcester and Lowell, then people could live more affordably in or around those communities and commute to jobs in the core. With adequate connectivity, the gateway cities could themselves become employment centers.”

Support from people like Brownsberger will help, said Finlan, but regional rail could still be 20 to 25 years away, if MassDOT even decides to pursue it.

“In order for gateway cities to merit this kind of state investment, they’ve got to do their part,” said Forman. “That’s why Rob’s seven-layer dip is so famous. It says, ‘Look, we are trying to do everything within our power to optimize development around this state asset.’”

“There’s a political will there that you just don’t have in every gateway community,” Corley added. “The way in which people in Brockton have been working together to turn things around.”

May says Brockton alone can’t convince MassDOT to bolster service on its southbound rail lines, which will soon extend to Fall River and New Bedford.

“There is very little political and commercial leadership representing Old Colony, representing the south, in these conversations,” said May, who is working with Forman and Corley to organize with other gateway cities this side of Boston. “The north will eat our lunch if we’re not at the table.”

But if May ends up invited, policy experts say his specialty dish will be the toast of the potluck.