You apply resistance to each source of damage
The section on "Resistance and Vulnerability" states:
Resistance and then vulnerability are applied after all other modifiers to damage [...]
This does tell us that Heavy Armor Master will always apply before any resistance, but we do need to know when modifiers are applied, which is covered in the "Damage Rolls" section:
Each weapon, spell, and harmful monster ability specifies the damage it deals. You roll the damage die or dice, add any modifiers, and apply the damage to your target. Magic weapons, special abilities, and other factors can grant a bonus to damage.
However this still doesn't quite tell us explicitly whether multi-attack has one big damage roll or one for each attack, but the "Making an Attack" section states this regarding what happens during an attack:
- Resolve the attack. You make the attack roll. On a hit, you roll damage, unless the particular attack has rules that specify otherwise. Some attacks cause special effects in addition to or instead of damage.
An attack deals damage when it hits and with multi-attack there are several individual hits and so damage (and thus resistance) is applied several individual times.
A small sidenote: resistance is also applied damage-type by damage-type, meaning that if a single thing deals multiple types of damage you apply resistance to each one that you resist separately, even if you simply resist the entirety of the damage. This is brought up in the question "Multiple Damage Resistance"
Also note that this has no bearing on Heavy Armor Master's damage reduction as that specifically reduces only the non-magical bludgeoning/piercing/slashing damage of a weapon:
When wearing heavy armor, bludgeoning, slashing and piercing damage you take from non-magical weapons is reduced by 3