T-Mobile’s $26 billion merger with Sprint may soon hinge on whether a judge believes media tycoon Charlie Ergen is a man of his word.

The coalition of attorneys general seeking to block T-Mobile from marrying Sprint plans to attack Ergen’s history of alleged broken promises to the government, sources tell The Post.

At a Manhattan federal trial kicking off Monday, the AGs will claim the billionaire — worth an estimated $10.5 billion, according to Forbes — can’t be trusted to replace Sprint as the nation’s fourth-largest wireless carrier, sources said. They will claim he “never plays by the rules,” a person with direct knowledge of the case told The Post.

In a lawsuit filed earlier this year, a group of AGs — led by New York’s Letitia James and California’s Xavier Becerra — asked the court to block the T-Mobile/Sprint merger by arguing that it will reduce the competition, which will lead to higher prices for consumers. The deal will lower the number of national wireless carriers from four to three and catapult T-Mobile from the nation’s third-largest carrier to No. 2, above AT&T.

T-Mobile and Sprint have shot back at the AGs’ claims by giving Ergen’s Dish the tools it would need to replace Sprint as the nation’s fourth-largest cellular company.

That sale, agreed to in July, gave Dish $3.5 billion worth of spectrum licenses as well as prepaid mobile phone businesses Boost Mobile and Virgin Mobile.

The AGs are planning to argue that Ergen can’t be relied upon to replace Sprint — in part by pointing to the horde of wireless spectrum he’s currently sitting on despite promises to the Federal Communications Commission to have made use of it by now.

“Dish has never shown any inclination or ability to build a nationwide mobile network on its own and has repeatedly broken assurances to the FCC about deployment of its spectrum,” James said in hinting at the legal strategy on July 26.

She was referring to Dish’s previous purchases of spectrum from the government, which included promises to build a wireless network serving 40 percent of the US population by May 2018. Dish also agreed to provide cellular service to 70 percent of the US by 2020.

But Dish’s government-issued spectrum, which it bought at government auctions in 2008, 2013 and 2014, still lies dormant.

Ergen, who is expected to take the stand at trial, will likely argue that Dish has never technically broken any of its promises because the FCC has repeatedly agreed to push back Dish’s deadlines to deploy the valuable assets.

Critics speculate that Dish, which has been criticized as a “warehouser” of spectrum, has been collecting spectrum in order to flip it down the road when it’s worth more money. “We’ll all believe Charlie is building a new network when we see it,” one critic told The Post.

A Dish spokesman declined to comment beyond pointing The Post to public documents that demonstrate its commitment to building a fourth wireless network.

For example, if Dish fails to provide cellular service to 70 percent of the country by 2023, it has agreed to pay the US Treasury a voluntary contribution of $2.2 billion — a deal that the FCC says is “binding.”

But sources say the agreement could be hard to enforce because it’s all part of a voluntary deal and the upfront cost, at $1.4 billion, is small compared to the billions it would take to build out the network.

In other efforts to ding Ergen’s credibility, the AGs might also bring up the time when EchoStar, the predecessor to Dish, violated the now-dead Satellite Home Viewer Act, Ergen critics said. The rules required EchoStar to not broadcast network stations like CBS and ABC via satellite to any customer who could get those stations with an antenna. But Ergen did it anyway, according to sources and court papers.

“He just put his dishes wherever he wanted,” a regulator in charge at the time told The Post. “He was in violation and could have been fined.”

EchoStar wasn’t fined, but it was sued by CBS. The case was settled in 2007 when EchoStar paid CBS and other networks $100 million.