The MTA’s $51.5 billion plan to modernize New York City’s crumbling transit system will saddle it with $38 billion in debt — on top of the $44 billion it already owes, according to Moody’s credit agency.

By 2026, the MTA’s debt will be over four times its annual revenue, creating a potentially disastrous scenario for an agency already answering massive deficits with service cuts and fare hikes.

To avoid financial calamity, “MTA could turn to additional fare increases or service cuts that would exacerbate negative ridership trends, and its financial position could decline further,” Moody’s said in its Oct. 3 rating determination, which deemed MTA bonds a sound short-term investment.

But without money to fund its next capital plan, the MTA won’t be able install elevators, replace old trains and buses, modernize its signal system or rehab stations.

That makes new borrowing worth it because if the capital plan it funds works as intended, ridership should increase — and with it, revenue, according to Moody’s Oct. 9 follow-up analysis.

“The new debt load would be partially balanced by system investments that will foster economic expansion and ridership growth, as well as generate new asset value for MTA,” the analysis said.

The increasing debt is not an immediate red flag, but rather “a warning sign that you have to make sure you have the revenues to cover it,” Citizens Budget Commission president Andrew Rein told The Post.

“Given that we have these capital needs, you don’t want to stop what you have to do,” he said.

The sooner those capital investments pay off, the sooner the MTA will see new revenue. Otherwise, the debt could fall squarely on riders in the form of either fare hikes or service cuts, one top-ranking state rep warned.

“Every penny that they borrow has to be paid back. Those are monies that come out of the operating fund, and they’re already at the edge there,” Assemblywoman Amy Paulin (D-Westchester), who chairs the public authorities committee, told The Post.

“It looks like there’s going to be more pain before we gain,” she said.

In a statement, the MTA pointed to revenue approved by the state legislature earlier this year — which Moody’s accounted for — as well anticipated cash contributions from the state, city and federal governments, which the agency hopes will add up to $16.7 billion.

Backed by those monies, the capital plan “will bring the system into the 21st century and provide the level of service our 8 million daily riders demand and deserve,” agency spokeswoman Abbey Collins said.