A mounted opponent who fails the save regards all creatures as enemies, including the mount they're riding
The enemies abound spell description states:
You reach into the mind of one creature you can see and force it to make an Intelligence saving throw. A creature automatically succeeds if it is immune to being frightened. On a failed save, the target loses the ability to distinguish friend from foe, regarding all creatures it can see as enemies until the spell ends.
The direct effect of the spell is clear: if the target fails its save, it regards all creatures it can see as enemies. Assuming the target is riding a creature (rather than a Broom of Flying or Carpet of Flying or something), and assuming they can see, they would indeed regard their mount as an enemy as well.
There are no special rules by default for attacking a hostile creature you're riding, or dismounting one
By default, the rules don't generally handle such a unique case; especially since the enemies abound spell was added in Xanathar's Guide to Everything rather than appearing in a core book, I'm guessing the designers didn't necessarily anticipate the spell's existence when writing the rules.
However, there is a potentially relevant optional rule on DMG p. 271, under the Action Options heading, titled "Climb onto a Bigger Creature":
As an alternative, a suitably large opponent can be treated as terrain for the purpose of jumping onto its back or clinging to a limb. After making any ability checks necessary to get into position and onto the larger creature, the smaller creature uses its action to make a Strength (Athletics) or Dexterity (Acrobatics) check contested by the target’s Dexterity (Acrobatics) check. If it wins the contest, the smaller creature successfully moves into the target creature’s space and clings to its body. While in the target’s space, the smaller creature moves with the target and has advantage on attack rolls against it.
The smaller creature can move around within the larger creature’s space, treating the space as difficult terrain. The larger creature’s ability to attack the smaller creature depends on the smaller creature’s location, and is left to your discretion. The larger creature can dislodge the smaller creature as an action—knocking it off, scraping it against a wall, or grabbing and throwing it—by making a Strength (Athletics) check contested by the smaller creature’s Strength (Athletics) or Dexterity (Acrobatics) check. The smaller creature chooses which ability to use.
The DM may choose to apply similar mechanics in the case of a creature affected by enemies abound that is mounted on another creature. Most mounts would likely not be able/intelligent enough to attack their rider, and thus would likely simply attempt to use their action to dislodge the rider if the DM decides to use these rules (assuming the rider attacks the mount first).
CC takes the hit.
The horse is the one provoking the attack of opportunity, no matter who the attack eventually targets.
After the attack of opportunity has been provoked, the troll is simply making a melee attack against a target - and the Mobile feat does not provide you immunity to being targeted by melee attacks.
Some context about opportunity attacks, mounted combat, and the mobile feat:
When riding a mount, you are moved by someone without using your movement, action, or reaction, and as such you do not provoke an opportunity attack.
You also don’t provoke an opportunity attack when you teleport or when someone or something moves you without using your movement, action, or reaction. (Chapter 9, Making an Attack - PHB)
Mounted combat also specifies that an attacker can choose to target you with an opportunity attack even when you don't provoke one, if your mount provokes an opportunity attack.
if the mount provokes an opportunity attack while you’re on it, the attacker can target you or the mount. (Chapter 9, Mounted Combat - PHB)
So in actuality, the Mobile Feat provides no real benefits while mounted:
You are using your mount's speed to move, so the speed increase does not matter;
Your mount would be the one taking the dash action, not you;
You already do not provoke opportunity attacks when mounted.
And aside from that, the discerning rider might want to have his mount Disengage as its action, avoiding this situation entirely.
Best Answer
The attack is wasted if there are no other creatures nearby, assuming the saving throw against sanctuary is failed.
If you're attacked first, then sanctuary activates. Assume the creature fails its save, because if it passes, the question is moot. The only available target is your mount, which it then chooses to attack. Mounted Combatant can then be used to force the attack to target you again. If the creature fails again, the attack is wasted, as the attack is forced to target you instead of your mount.
If your mount is attacked first, you can use Mounted Combatant to force the attack to target you instead. Sanctuary then activates, and the creature fails. It's unable to attack the mount again, because you've forced it to target you instead, but it's also unable to target you, so it's attack is wasted.
In both cases, after you've used Mounted Combatant, the mount is not a valid target, because the feat "force[s] an attack [...] to target you instead". Since this is the same attack, and it's been forced to not attack the mount because of this feat, it cannot be re-targeted, even after sanctuary applies.