For weeks, the MTA has been psychologically torturing Long Islanders — pretending they were about to endure a railroad strike only to let Gov. Cuomo “save them” from that fate Thursday.

MTA chief Tom Prendergast — whose job is to protect the MTA’s customers, not participate in Cuomo’s mind-games — should be ashamed of the way his supposedly “independent” authority has treated its captive commuters this summer season.

It’s plain Cuomo was never going to allow a strike. One clue was that he said last week that a strike would be a “failure . . . by the MTA.”

Here was the script at Thursday’s press conference: The state-run MTA and the Long Island Rail Road unions were so far apart they just couldn’t agree to a deal. Not until the governor, parentally concerned about the fate of his poor commuting Long Island voter-children, stepped in late Wednesday night.

“It’s my pleasure to announce today that we have settled a four-year dispute,” Cuomo said.

Sure, he duly noted that “Prendergast runs the MTA.” But the governor also noted that “if there is a crisis . . . when we got to the point last night when we were on the cusp of an impending strike . . . I believe that was the right time . . . to step in.”

Conveniently, Cuomo stepped in and solved the strike on Thursday afternoon, rather than the Friday before a weekend strike — meaning that the news of his heroism would make the weekday papers, when more people are paying attention.

Anyway. Just as it’s no surprise that the LIRR isn’t going on strike, it’s also no surprise that the deal is bad for the MTA.

As Cuomo admitted, the unions got pretty much everything they asked for — 18.4 percent raises over 6½ years.

Sure, that split the difference between what the MTA wanted (seven years) and what the unions wanted (six), but so what?

On its most important request — that new workers would pay more for health care than existing workers will — the MTA caved. (There go big longterm cost savings.) And remember — the MTA already caved on work-rule changes and other important stuff months ago.

Does the deal pay for itself, as Cuomo and Prendergast implied yesterday?

The governor said that, after he’d so magically gotten everyone to agree, “The question then became how do you pay for it.” To answer that, he gave vague answers like “there are health-care savings” and other measures to “allow the MTA to pay.”

Not true. The MTA has already said (in writing, to bondholders) that its previous offer to the unions would cost $64 million upfront — and another quarter-million dollars or so a year after that for the rest of our lives.

We don’t know much about the deal, because, as union chief Anthony Simon said, “we [should] explain it to our members before it goes out to the public.”

But we know it’s not free.

We also know that the MTA is looking at a $255 million deficit two years from now — and that it has no money for capital investments.

And we know that the MTA has only two ways of raising money: hiking fares, or raiding its capital funds. Anything that costs money, then — as this deal does — eventually means higher fares or less investment.

Sorry: When Prendergast said yesterday that “this deal puts no additional pressure on the fares,” it just wasn’t true, either.

And this came just three days after Prendergast said that, as an MTA board member, he had a legal “fiduciary responsibility” not to do a harmful deal.

Yes, Prendergast and the MTA clearly face pressure from the governor, too. But Prendergast was paid $359,877 last year — more than the governor — partly to provide him with a measure of independence from the governor. If he can’t act independently, he should say so.

Of course, New York pols and their appointees do bad labor deals all the time.

The worst thing here is that nobody had any qualms about asking riders (who make a fraction of that income) to change their vacation plans — thus incurring a financial cost — to accommodate a strike that everyone knew would never happen.

Nicole Gelinas is a contributing editor to the Manhattan Institute’s City Journal.