The Measure of a Man
You have stated that your story ends with the ruthless barbarian in power, and now that he has that power you want him to be a benevolent ruler. So I am going to do a slight reframing and say the inherent question is: What kind of man does anything to gain power and then uses that power to elevate his subjects? I can see a couple of options here that focus on the backstory and personality of your tyrant.
Note that I am moving away from the idea of this benevolence being caused by governmental structures. The fact is that if the ruler has absolute power and was ruthless enough to gain power, he would not hesitate to remove or subvert anything that stood in his way. It would just be another extension of his initial rise to power.
The Dauntless Ideologue
Your tyrant is a man of uncompromising ideals who is willing to do anything to remake the world into whatever he feels like it should be. In this case I would consider him being a victim of injustice caused by the previous government/system. He joins the civil war not out of a desire to rule, but a desire for change. He is a man that steps up to solve the problem because no one else will.
Whatever kind of positive outcome comes from his rule is intentional. The whole point to all of his previous actions was to get a place where he could enact change and raise his people up. His actions looked ruthless and cruel to the factions that he fought against but his supporters see him as a guerilla fighter and a hero of the people.
The Heartless Altruist
This tyrant is after power and actively sought out his rule using any means necessary. Violence, assassination, blackmail, extortion. Your ruler is coldblooded and sees the people around him as little more than pieces on a game board, to be moved and used and manipulated in whichever manner provides the optimal results for himself.
All of that said, this kind of ruler is not a cartoon villain who is Evil for Evil's Sake. Manipulating people for your own goals does not inherently mean harming them. After a brutal civil war the nation will want peace and to heal. Your tyrant will do as much as possible to facilitate this and make the common people happy as part of his plan to consolidate his power. With enough political savvy your ruler could easily purge his political enemies and spin it as him casting down the old guard and reforming the nation. Taxing the nobility or wealthiest merchants lets him raise capital to be spent on civic projects like better roads and more schools or hospitals. And if that also happens to bankrupt his political opponents and naysayers then really everyone wins.
The Charismatic Fanatic
This one is a bit simpler in terms of motivation, but also requires some assumptions about the people in the nation. This ruler is driven similar to the Ideologue but his motivation is external instead of coming from a personal principle. The tyrant is a true believer in a religion or other cause, and sees the civil war as a way to further that cause. He is able to rally the people using impassioned speeches quickly gains massive amounts of popular support in his bid to unite the country. His army of peasants and farmers may not have the same quality as the other factions, but quantity has a quality of its own.
This is going to be a finer line to walk for what you want than the other two examples, just because it is so easy for this type of leader to be exclusionary. Our history is pretty rife with people who rode a wave of demagoguery to power and then proceeded to only make things better for the part of the population that agreed with/supported them. Depending on your exact definition of "benevolent" there is a lot of wiggle room for some group to be suppressed while the ruler's base is elevated. That kind of dynamic is really sustainable unless the suppressed group is in the minority, in which case you have more or less invented Hitler.
Assuming you can get around that hurdle and not make the ruler a fantasy fascist, the rest of it comes together nicely. He is ruthless because he is serving a higher power/ideal and that always gives people an excuse. He is benevolent because that is also part of what he believes in. This leader even has something like a structure or group that can help mitigate their worst traits, since there is bound to be some church or organization already in place that will have a say in things.
Heavy Lies the Head
Your ruthless tyrant is a person and people are almost never one dimensional robots. He will have a history, personality, flaws, and a worldview which will all contribute to the actions he takes. You already know the end result, things getting better when no one would have expected that. The rest of the job is just working backwards from there and deciding exactly what kind of a man would end up in that situation.