This is In a Good Cause by Isaac Asimov
You got most of the details right.
This is probably a duplicate.
The two young men are friends. Both recognize that humanity has to consolidate or else be overrun by other races that are also colonizing the galaxy.
Humans have taken their divisive ways out to the stars - each colony is independent or else tries to dominate a smaller group of other planets.
The other races - especially the Diaboli - are united. The colonies work together with each other and with their home planet to colonize more planets.
If humans don't manage to unite, the other races will settle all the other usable planets and leave humans fenced in their small volume of space.
Both men recognize this, and try to get the colonies and Earth to unite.
One is an idealist. He thinks that they should convince people to unite by reasonable means - protest against the wars between Earth and the colonies and between colonies, and explain the threat of being out numbered and surrounded by the aliens.
The other man is a realist. He knows that people rarely do the right thing for the right reasons - they usually have to be tricked into it.
The idealist protests the wars and organizes groups of dissenters to try and get Earth and the colonies to unite. He is arrested again and again.
The realist joins the Army, and works his way up through the ranks. He retires from a high Army rank and goes into politics, also climbing up through the ranks.
The two men meet several times over the years, mostly when the realist has to have his friend arrested and put in jail.
The realist worked all the years behind the scenes to arrange things so that the colonies had to unite to survive against Earth and the planets under Earth's influence.
At the end, there are just two groups: Earth against the united colonies.
This was the realist's plan. Rather than a bunch of small groups, there are just two that can be tricked into joining into one.
The realist gets rumors started that the Diaboli are converting Earth type planets into planets that would better suit the Diaboli (they need sulfur compounds in their food and the air, hence the name.)
Through some careful management (including a failed attempt to assasinate some Diaboli ambassadors by the idealist,) the united colonies join Earth against the Diaboli.
Because the humans had so many wars behind them, they were better equipped and trained for battle than the Diaboli - the war was short and decisive, with Earth and the colonies winning easily.
For the realist, the problem had always been to get all the colonies to side with Earth, without any going over to the Diaboli.
When the two men meet for the last time, it is for the realist to release his friend from prison into a united humanity. He explains what he spent all those decades working for, and that it has all finally come to a successful end.
The realist wants his friend to be the "face" of the unified humanity - people will want an ideal to celebrate and remember, rather than a conniving trickster who fought wars and duped people into doing the right thing. The idealist will be Earth's representative for the peace talks being held to form a single government for all humans.
The beginning of the story tells of a statue of the idealist (Richard Altmayer,) and the epigraph on it:
In a good cause, there are no failures. There are only delayed successes.
That was what Altmayer said each time his friend Geoffrey Stock (the realist) put him in jail.
Stock sends Altmayer out to represent the ideals of the union, knowing he himself will be seen in a negative light.
He tells Altmayer that he (Altmayer) will be remembered long after the United Worlds is a reality. As he turns away to leave, Altmayer hears Stock say to himself "And when they build their statues, they will build none for me."