See "All Together Now" at the bottom for the summary.
You've kind of answered your own question. Assuming that you're level five, you have Extra Attack (1), those two feats (and you're using the sharpshooter bonus), and a Dexterity of 16...
Hand Crossbow is going to be better in that scenario.
49.5 damage for three hits is just better than 37 damage for two hits.
However, there are some things that skew this one way or the other.
Factoring in hit-chance
If you're not using the "bonus" from the Sharpshooter feat, that brings you down to 17 damage (Heavy) vs 19.5 damage (hand). It's still in favor of hand crossbow, but when combined with the points below, it might tip the scale.
Factoring in critical hits
Hits are more or less likely to be critical hits, depending on how likely it is for you to hit in the first place.
If you need a high roll to hit, then it's likely that many of your hits are going to be critical hits. Expected critical damage is 28 (Heavy) and 26.5 (Hand), if you're not using the sharpshooter bonus (48 heavy and 56.5 hand, with the bonus).
This is especially true for Champion Fighter's expanded critical range.
Keep in mind that the half-orc trait, brutal critical, and Savage Attacker only trigger on melee attacks.
Factoring in additional attacks.
(Ignoring higher ability scores)
When fighters get Extra Attack (2), expected sharpshooter damage goes up to about 55.5 (Heavy) and 66 (Hand), but expected non-sharpshooter damage to 25.5 (Heavy) and 26 (Hand)
And Extra Attack (3) brings us up to sharpshooter 74 (Heavy) and 82.5 (Hand), with non-sharpshooter damage at 34 (Heavy) and 32.5 (Hand).
The Heavy Crossbow is better here.
Additionally, things like Action Surge, Haste, etc. also lean towards Heavy Crossbow
Factoring in higher Ability Scores (and damage increases)
Increasing your Dexterity to 18 or 20 (or beyond) are going to lean this towards the hand crossbow by the increase of the modifier (+1 modifier makes it +1 damage better, etc.). This is equally true of anything that's going to bump your damage. Magic ammunition, a vulnerable enemy, Elemental weapon, etc. are all going to have a similar effect, wherein more attacks is better.
Finding a special Hand/Heavy Crossbow
A +3 Heavy Crossbow of Awesomeness is almost always going to be worth using over most mundane Hand Crossbows.
Limited ability to take bonus actions
If something is limiting your ability to take your bonus action (slow, needing it for something else, etc), then that makes the Heavy Crossbow strictly better.
All together now
Almost always, for most characters, the Hand Crossbow is going to be better if you have Crossbow Master and Sharpshooter.
The exceptions to look out for are getting significantly more attacks (Fighter Action Surge, Fighter Extra Attack, Haste, etc.), extremely hard to hit enemies (I'm not going to do the math to figure out exactly what die roll you need, but high), and finding a magic Heavy Crossbow.
Additional Notes: BBeast, rightly, points out that if your opponent is outside of the Hand Crossbow's maximum range (120), but within the Heavy Crossbow's maximum range (400), then the Heavy Crossbow wins by default.