Well, you could check out 'The Unexpected Hero'. In this fanfic, Draco steps in and saves Hermione from the troll in a rather dramatic turn of events. The author does a great job of building the tension and making the rescue scene exciting.
Well, in many such fanfictions, Harry might use his magic skills. He could cast a powerful stupefy spell on the troll to stop it in its tracks and then quickly lead Hermione to safety. Maybe he also uses his quick thinking and knowledge of the Hogwarts corridors to find a hiding place where the troll can't reach them.
Well, in some versions, they might use their knowledge of the castle's secret passages to lead the troll away from Hermione. They could also work together as a team, using their Slytherin cunning to outwit the troll.
Well, perhaps Snape uses his position as a teacher to step in. He could have been observing the situation secretly and when Draco was about to do something harmful to Hermione, Snape intervened with a firm command or some magic spell to stop Draco in his tracks.
Well, in some versions, Ron might use his quick wit and knowledge of Hogwarts' secret passages to outmaneuver Draco. He could lead Hermione to safety through a passage that Draco doesn't know about.
One reason could be Snape's sense of justice. Despite his often - cold exterior, he might not tolerate Draco's bullying behavior towards Hermione.
One possible motivation is a sense of morality that Draco has buried deep inside. Despite his upbringing in a family of Death Eaters, he still has a conscience. Seeing Greyback about to harm Hermione, who is essentially an innocent in the face of such a brutal werewolf, stirs that conscience. Another factor could be his own self - interest. He might realize that by saving Hermione, he could gain some sort of leverage or protection in the complex world of the wizarding war.
Love. In fanfictions, it's a common motivation. Draco might have fallen in love with Hermione over time, and that love drives him to risk his life to save her from Voldemort.
Draco could be seeking redemption. He may be tired of being on the wrong side of the war. Saving Hermione, who is a symbol of the good side, would be a significant step in his journey towards redemption. Additionally, he might be influenced by his friendship or alliance with some of the other characters who are on the side of the Order of the Phoenix. They could have convinced him to do the right thing and save Hermione from Bellatrix.
One motivation could be that Draco has developed feelings for Hermione. So, when he sees Viktor as a rival for her attention or a threat to her safety, he takes action to save her.
One reason could be that the troll is simply on a rampage and Hermione was in the wrong place at the wrong time. Trolls are not known for their intelligence, and it might have just stumbled upon Hermione while wandering the Hogwarts halls.