The agency that runs New York City’s troubled subway said on Friday that it plans to spend close to $4 billion to buy over a thousand new train cars to modernize an aging fleet, a major investment meant to help remedy the delays and breakdowns that plague the system.

New York will also join other cities around the world in deploying trains with open pathways between cars that can squeeze in more riders at a time when the subway struggles under the burden of accommodating nearly six million riders every day.

The first cars, which will be manufactured under a contract between the Metropolitan Transportation Authority and the Japanese company, Kawasaki, are scheduled to be delivered in July 2020.

The contract, which still has to be approved by the M.T.A. board, is split into three phases. At the outset, the authority has committed about $1.45 billion to buy over 500 cars with an agreement to take steps to purchase more if the initial group performs well, for a total of 1,612 cars. The contract could ultimately pay Kawasaki more than $3.7 billion with the financing being provided by the federal Transit Administration. To win the contract, Kawasaki had to demonstrate it could deliver the first batch of cars 30 months from the day it is officially awarded, after the board votes later this month.