I'm not entirely sure but my best guess is by decree from the king/emperor. Also, I think blood relations/services/influences are important too. If I'm not mistaken, ML is supposedly an illegitimate son of the emperor so he has more royal blood than whatever second cousin thrice removed royal blood the duke's family probably had. But ofc, since the son thing is top secret, I can only assume that the emperor publicly granted ML with grand duke title with the justification of his services to the empire.
In my own understanding, Grand duke like Hexion, is higher and more powerful than Duke since one can be called Grand Duke if they are directly related to the royalty while the title of a Duke can be gained through wealth, war achievements or if the title will be given by the King. If my understanding have some mistake please feel free to correct me

Exerts that Grand Duke dominance, boi