Game of Thrones seemed to heavily imply that Tyrion is gearing up to betray Daenerys in season 8. Their relationship has been on unsteady ground for some time now, and "The Last of the Starks" made it seem like his devotion to the Dragon Queen is starting to critically waver.
Winning the Battle of Winterfell and stopping the Night King doesn't result in the unity Jon and Dany were hoping for. The Stark sisters aren't any more welcoming to the Dragon Queen in the aftermath of the battle (despite Dany declaring Arya a hero and legitimizing Gendry) and the truth of Jon's parentage continues to drive an impossible wedge between the erstwhile lovers. It's not long before Dany's making questionable decisions regarding the invasion of King's Landing and Tyrion and Varys are wringing their hands and wondering if Jon wouldn't be a better candidate to rule the Seven Kingdoms than yet another temperamental Targaryen. Once Sansa tells Tyrion about Jon's real parents and he tells the Spider, Varys becomes almost totally convinced that Jon is the preferable choice "for the realm," as Tyrion begs him to reconsider.
But despite Tyrion's devotion to his queen, it's starting to seem more and more likely that he'll wind up betraying Dany in the end - if only for the good of Westeros. Varys rightly points out that Dany doesn't listen to anyone, which essentially makes her a tyrant the likes of which she's tried to fight her whole life. When Tyrion suggests the idea that Jon and Dany could rule together, Varys reasons that despite Jon's popularity and good instincts, his devotion to Dany and his duty would make him unable to ever stand up to her effectively. Her power would remain unchecked and it's getting harder and harder for Tyrion to ignore the fact that he could be helping another power-mad Targaryen ascend the Iron Throne. Presumably that's why he's drinking wine by the jug instead of the glass.
Despite her crucial role in winning the Battle of Winterfell, Daenerys' public perception hasn't gotten any better. Jon is still markedly more popular than she is, despite the fact that without her help, the Night King would've probably been victorious. And now that Jon's parentage acts as a huge wedge between them, she's more alone and more determined than ever to complete her mission to take the Iron Throne. But her myopic refusal to wait until their armies are recuperated and Jon's unquestioning support of her decision reveals just how much trouble Dany's camp is in. Her lack of forethought in the decision to bring the troops south immediately following the Battle of Winterfell lost her a dragon, half her fleet and Missandei. Tyrion remains by her side, but there's no way she's going to listen to anyone now that Cersei has killed one of her closest friends and advisors.
While "The Last of the Starks" saw Tyrion pleading with Varys not to find some way to eliminate Dany in favor of Jon, it feels like Dany's irrationality, temper and grief are starting to win out over her better judgment. She has listened to Tyrion in the past, but considering his recent track record and her enraged and grief-stricken state of mind, it doesn't seem likely he's going to be able to pull her back from any more rash decisions. If his advice and counsel continues to fall on deaf ears, Tyrion will have to choose between his love for Daenerys and his commitment to making Westeros a place free of men like his father and hers.
If the only way to do that ultimately becomes switching his allegiance to Jon, it seems likely that Tyrion would betray his queen for the good of the realm - especially if her behavior continues to serve as evidence she's becoming unfit to rule like many Game of Thrones monarchs before her.
Game of Thrones continues Sunday at 9pm on HBO.