Hi there.
Correct order is: cards are revealed -> starting with active Player (the one that tries to pillage) surviving units are selected -> other units die -> Heimdall cards are played.
BGA Version has simultanous sacrifice after all Heimdalls are played.
Its the biggest Timing issue that is left in the game (a similar, more minor issue is that you can use your last rage to keep a card with prowess when someone leeches you with trickery. However trickery should trigger first).
The dev was quite active during beta in fixing as per Feedback. Unfoftunately we Players did not catch above two issues then.
It is some time now since he moved on from this Implementation. I for my part don't expect changes any time soon and have accepted this is how this Iteration of the game works.