We'll recap for you. Raoul is dead, Athos is dead, and Porthos is dead. D'Artagnan is fighting a war in Holland, and Aramis is now a Spanish duke. The novel ends with D'Artagnan becoming a distinguished marshal of France, and then getting hit in the chest with a cannonball and dying. The narrator closes the story by pointing out that only Aramis is left alive out of the original four friends.
Now, if you want to read The Man in the Iron Mask as historical commentary, and if you like reducing each of the four friends into single attributes, we have an interpretation for you. Jacques Zipes, in the "Afterword" to the Signet Classics edition of Man in the Iron Mask, published in 2006 states:
Louis's rise to greatness demands cold calculation and total administration that will not and does not have any use for the strength (Porthos), dignity (Athos/Raoul), and loyalty (D'Artagnan) of the Musketeers. Only Aramis survives at the end because he is unscrupulous and cunning and embodies a modern spirit that is on the rise in France of 1848-50.
This interpretation calls for seeing the end of the novel as signaling the end of an era. Strength, dignity, loyalty, and honor have gone out the window. Only unscrupulous cunning is left, according to this interpretation, as the King consolidates his absolute power. With this reading, you can see the marshal's baton as striking a note of heavy irony – it doesn't matter that D'Artagnan has achieved a great accomplishment, because he is already a relic of a past age. There is no use for men like D'Artagnan in Louis's empire; it is fitting that he dies.
Lastly, we turn your attention to D'Artagnan's last words, which are possibly the most cryptic final words in all of literature: "Athos – Porthos, farewell till we meet again! Aramis, adieu forever!" Clearly Aramis is being set apart from the other three, but in what way? Is D'Artagnan expecting to see Athos and Porthos in heaven, but expecting Aramis's soul to go elsewhere? Is this an expression of anger at his old friend? Or is it simply distinguishing the dead from the living? Even the narrator tells us that only D'Artagnan himself has the answer to these questions.