It should be possible to cast Burning Hands in this manner
The rules for Somatic Components of Spells stipulate that at least one hand must be free to successfully perform the spell.
Spellcasting gestures might include a forceful gesticulation or an intricate set of gestures. If a spell requires a somatic component, the caster must have free use of at least one hand to perform these gestures.
—Components, Player's Handbook, pg. 203
Strictly speaking, you don't need to use two hands to hold a staff; you might need to use two hands if you attempt to make a melee attack with one*, but because you're only required to hold the staff in one hand, you satisfy the somatic components.
* The only staff in the PHB weapon list is a Quarterstaff, a one-handed weapon with the Versatile property; so such a "two-handed staff as a melee weapon" weapon would have to be some kind of homebrew.
Which brings us to the question of satisfying the particular requirements of Burning Hands. As the top listed answer in the question you linked indicates, Flavor Text isn't a real thing in 5th Edition D&D: everything is mechanics, everything has mechanical consequences. So because Burning Hands has a strict requirement to "hold your hands with thumbs touching and fingers spread", we need to adjudicate two issues:
Physically holding the staff in this manner
I'm dubious about the claim that you're going to hold the staff by hooking your thumbs under the staff: certainly, it's possible, but I suspect that as a matter of practicality, a five-fingered humanoid would probably prefer to use their pinkies to hold up the staff—and at that point, what do you need the thumbs for?
Sitting at my desk, writing this answer out while testing with two pencils I've taped together, it's more comfortable to hold them up with my pinkies than with my thumbs or using my thumbs and pinkies together. Both of the latter examples are possible—although in the former case I had some issues balancing the pencils—but neither is preferable, to me, as simply holding them with my pinkies. So maybe this answer is something of a frame challenge: don't use the thumbs to hold the staff up.
Either way though: the requirement of the spell is to "hold your hands with thumbs touching and fingers spread", and I can at least verify that it's possible to make these kinds of gestures while holding onto an object in this manner. And since we've satisfied the strict Somatic Components requirements (being able to have a hand free), I think it is appropriate to rule that casting the spell in this manner does not constitute the Somatic components being "disrupted" with mechanical consequences.
Does the staff block Line of Sight to the targets?
Just so our bases are covered: there's a risk that casting Burning Hands in this manner would occlude some of the flames as they erupt from your hands.
Your DM will have to make a ruling, but if there were to be a mechanical impact from casting the spell like this, I would personally not rule the impact is greater than providing Half-Cover to your targets, which would give them +2 to their Dexterity Saving Throws—and in practice I'd be unlikely to even apply this, since depending on what you consider to be the "origin" of the cone of effect (the thumbs, maybe?) it's certainly possible to orient the staff such that it doesn't intersect the volume of the cone.