A monthslong dispute over funding for the Metropolitan Transportation Authority ended Saturday morning when New York City agreed to commit $2.5 billion to capital projects.

The city had been under increasing pressure from Gov. Andrew Cuomo to contribute more to MTA’s 2015-2019 $26.1 billion capital plan, the largest such investment in MTA history. The plan is designed to pay for major repairs and improvements to New York City’s subway and bus systems, along with two major commuter train services, the Long Island Rail Road...