Celebrim
Legend
However, if one reads that folklore and fiction, one other matter comes through: the Devil typically wins against the wicked, but loses against the righteous. If his deal is ironclad in his own favour, with nothing the devil overlooks which might allow a PC win - that, too, is not true to the folklore. The challenge also includes building the contract to be one that challenges, but does not guarantee defeat, for the PC's.
I concur, but typically in folklore, The Righteous isn't the one that entered into the contract willingly, but rather inserts themselves into the deal as a way of saving the unrighteous from the fate that they deserve since they deal with devils.
Probably the best example of this in modern fiction was from the first season of The Simpsons, where Homer sells his soul to the Devil in exchange for a Donut and Marge is forced to save him from Hell. However, there are tons and tons of examples of this, from the poker game in "Oh God, You Devil" to the game Dream plays to get his possessions back from the powers of hell.
I concur that the Righteous beat The Devil at his own game because The Devil is unable to foresee some good deed, but the Righteous don't chose to play the Devil's game in the first place. They play only because the deal already exists and they are forced to undo the deal, usually by showing The Devil that the game was always in Good's favor all along (Marge's proof that Homer couldn't have sold his soul to the Devil) or that Evil is stupid because lacking empathy and compassion, it can't imagine motives of hope and love and so has not foreseen the obvious flaw in the plan - Sauron's inability to imagine humility for example, and so accounting perfectly in his reckoning for all plots of his enemies except the ones they actually use.
If you are going to follow this trope, the rescue of the PC's would come through the intervention of a righteous opponent of the deal, and the undoing of the deal might actually be incredibly simple - actually sanctifying the Dagger of the Sun so that it becomes Holy. Once invigorated by the blessing of the righteous, the dagger might well prove to be utterly unendurable by the Devil that made the deal and all the denizens of Hell. One can easily imagine the restored radiant dagger being something the devil can neither bear to touch or even look upon, blasting all that it is evil with the radiant power of Holy sunlight for miles about it, disintegrating the very stones of Dis, being a fire that Hell cannot quench nor endure, and a beacon of hope Hell dare not place within its confines. Hell sought to shroud the sun in darkness, but darkness can't actually prevail over light and only can exist when light is absent. But if this trope is followed, the one entering the deal can't be the one to show the foolishness of the deal, and indeed it's his own unclean hands and impure intentions that soil the dagger enough to render it harmless. In D&D terms, that might actually make getting out of the deal simply apologizing to Helios and begging for his mercy (assuming Helios is compassionate and not a typical uncaring Greek pantheon jerk), allowing Helios to intervene to get his dagger back and ending the deal on favorable terms for the PCs. Presumably the PC's however are now in a Deal with Heaven, which by trope offer favorable terms, but all too easy to get out and even nastier if you break them.