For the last 20 years, the plan to dig new train tunnels under the Hudson River — among the most ambitious and important transportation projects in the country — has been repeatedly tripped up by political wrangling.

So when the governors of New York and New Jersey agreed on Tuesday to split evenly their share of the $14 billion first phase of the project — known as Gateway — the announcement struck a familiar note.

After all, two different governors had reached a similar agreement in 2015, when Chris Christie was New Jersey’s chief executive and Andrew M. Cuomo was still in charge in Albany. To say that progress on the tunnels has been slow since then would be an understatement.

While the actual digging of the tunnels is still at least more than a year away, the announcement on Tuesday was a sign that Gateway might finally be moving forward.

The project’s planners are racing to lock up federal funding while they have support from the Biden administration and Democratic leaders in Washington.

Before the federal government could agree to pay half or more of the cost, the two states had to come to an understanding about splitting the local share. The states did not specify how they planned to pay for their portions, but New Jersey has previously said that it would raise some of its share by issuing bonds.

“This agreement is a major step forward for Gateway,” said Sen. Charles Schumer, the Democratic majority leader. “I’d told the governors of New York and New Jersey unless they came to an agreement quickly, we’d not be able to procure federal funds for the first round of funding.”

The Gateway project had appeared to be on a fast track toward federal funding once before, during the Obama administration. But that momentum was lost when Donald J. Trump was elected in 2016. Mr. Trump refused to give Gateway the approvals and funding it needed during his four years in office.

How to divvy up the costs has been a source of acrimony in the past. Mr. Cuomo, a Democrat who resigned as governor last year after being accused of sexual harassment, resisted any obligation and famously declared, “It’s not my tunnel.”

He eventually reached an agreement with Mr. Christie, a Republican with a history of standing in the way of a new trans-Hudson tunnel. In 2010, Mr. Christie halted construction of a previous version, known as the ARC tunnel.

Sign up for the New York Today Newsletter  Each morning, get the latest on New York businesses, arts, sports, dining, style and more. 

Despite having the federal financing all lined up, Mr. Christie scrapped the project, balking at the possibility that New Jersey would be saddled with potentially hefty cost overruns.

One complication in reaching cost-sharing agreements has been that the primary users of the tunnels will be New Jersey residents who commute to New York City to work. They ride New Jersey Transit, whose trains were jam-packed before the pandemic. Transit planners expect even more demand for commuting across the Hudson in the coming decades. Still, New Jersey Transit has carried far fewer riders in the last two years as many workers have stayed away from their offices.

Now, the New Jersey governor, Philip D. Murphy, is cooperating with Mr. Cuomo’s successor, Kathy Hochul. Both Democrats, they have been vocal supporters of Gateway.

The sprawling Gateway project also involves expanding Pennsylvania Station in Manhattan and replacing a key rail bridge in New Jersey that leads to the Hudson. Rather than wait for Gateway to receive all the approvals it needs, Ms. Hochul has pushed for Penn Station, which she called a “hellhole,” to be renovated before rather than after Gateway is completed.

Ms. Hochul plans to let developers surround the station with super-tall towers in exchange for payments that would go toward the estimated $7 billion cost of renovating it. That plan has run into opposition from community leaders who question whether there will be enough demand for office space in Midtown to pay for the renovation.