Maybe Lucius wants to gain an advantage. He could see Hermione as a powerful witch with knowledge that he can use for his own ends. By saving her from Ron's beaten, he hopes to earn her gratitude and get access to her skills or information.
It could be part of a larger plan. Lucius might be aware of some impending danger that only Hermione can help prevent. By saving her from Ron's beaten, he ensures that she is alive and able to assist in whatever task lies ahead. He may also be trying to create an alliance with Hermione or the side she represents against a common enemy.
In the fanfic, Harry could be alerted to the situation by his magical intuition. He arrives just in time to see Ron raise his wand at Hermione. Harry, having practiced his dueling skills, quickly deflects Ron's spell and counter - attacks with a binding spell. He then pulls Hermione away from the scene. As they flee, Harry tells Hermione that they need to find a way to remove the negative energy that has seemingly taken over Ron. They might decide to go to the library to research on ancient spells that could help in such a situation.
Well, it could be that Lucius uses his powerful influence in the wizarding world. Maybe he intimidates Ron with threats related to his family's status or he uses some dark magic to create a distraction and whisk Hermione away.
One possible plot could be that in a dark and alternate version of the wizarding world, Ron has been influenced by some dark magic or a powerful enemy who has turned him against Hermione. Lucius, for his own reasons (maybe to redeem himself or because he sees the value in Hermione), steps in to save her. He might use his powerful family connections and knowledge of dark magic to counter whatever threat Ron poses.
Hermione might become more distrustful of Ron. After being saved by Lucius from Ron, she could start to see Ron in a different light, perhaps as someone with a darker side she hadn't fully recognized before. This could make her more cautious in her interactions with him.
Maybe Harry uses his magic skills to immobilize Ron. He could cast a spell like 'Petrificus Totalus' on Ron right when he's about to attack Hermione, thus stopping the beating.
In my version of the fanfic, Harry was in the Gryffindor common room when he noticed Ron's strange behavior towards Hermione. Ron seemed to be in a trance and was about to lash out at Hermione. Without hesitation, Harry jumps in front of Hermione and uses a Patronus charm to repel Ron. The Patronus, in the form of a stag, charges at Ron and knocks him back. Harry then holds Hermione's hand and leads her through the secret passages of Hogwarts. As they run, Harry tells Hermione that they need to find a way to break whatever spell or curse is on Ron. They end up in Dumbledore's old office, where they start to search for answers in the old books and magical artifacts left behind.
Perhaps Lucius is bored with his current situation. Helping Hermione gives him something new and exciting to do. He might also want to show off his power and influence. By being the one Hermione runs to, he can prove that he is a force to be reckoned with, and that he can be the knight in shining armor, even if his intentions are not entirely pure.
Well, perhaps he uses his influence in the wizarding world. Maybe he has some connections or knowledge that allows him to intervene and get Hermione out of the abusive situation. For example, he could use his status among the pure - blood families to put pressure on the abusers.
Hermione would probably be extremely hurt. She's a very loyal person, and to have Ron cheat on her would shatter her trust. She might become withdrawn, not wanting to talk to anyone at first, and just try to process the pain on her own. Then she decides to run to Lucius, perhaps because she feels she has nowhere else to turn, or she thinks Lucius can offer her some sort of solution or support.
Another plot twist could be that Lucius's act of saving Hermione causes a rift between Hermione and Ron that is hard to repair. Ron might misunderstand Hermione's connection with Lucius and think she is now on the 'dark side' so to speak. This could lead to a complex love triangle situation where Hermione has to prove her loyalty to her friends while also dealing with her gratitude towards Lucius.