The Troll's Regeneration feature states:
The troll regains 10 hit points at the start of its turn. If the troll takes acid or fire damage, this trait doesn't function at the start of the troll's next turn. The troll dies only if it starts its turn with 0 hit points and doesn't regenerate.
Let's assume heroism has been cast on the Troll, a spell which states:
[...] Until the spell ends, the creature is immune to being frightened and gains temporary hit points equal to your spellcasting ability modifier at the start of each of its turns [...]
Let's also assume the troll has taken acid/fire damage, and is at 0 HP. What happens at the start of its turn?