Short Answer:
Officials of all classes start out lower and if competent are promoted to higher ranks. But officials who come from higher ranking classes start out at higher ranks than officials who come from lower ranking classes.
And even the most democratic politicians accept that class bias because the number of levels in the government hierarchy is so large that nobody could start at the bottom and be promoted all the way to the top during their career. Since the top positions have to be filled, even the most democratic politicians accept that much class bias in appointments, but no more.
Long Answer in five parts:
Space is big. Very, very big. And very, very complicated.
Part One: the size of a galaxy spanning government.
the tiniest dwarf galaxies each have about a million star systems. Our Milky Way Galaxy has at lest a hundred thousand times as many stars, at least 100,000,000,000 star systems, and possibly several times that many.
The disc of the Milky Way galaxy is about 100,000 light years in diameter, so a galaxy spanning government would rule over at least a distance of 50,000 light years and rule at least a quarter of the volume of the galactic disc.
So I would say that a galaxy spanning government would rule a volume of space containing at least 10,000,000,000 star systems. It is perfectly possible for humans from the habitable planet Earth to colonize our entire solar system and use asteroid and comet material to construct countless thousands and millions of space habitats so that our solar system could support trillions or quadrillons of humans.
A space empire might find that only one star system out of a hundred would have a planet that humans could colonize. And thus one ruling over at least 10,000,000,000 star systems would rule over at least 100,000,000 habitable planets that humans could colonize. Each habitable planet should be able to support at least 1,000,000,000 humans, so the space empire should be able to have a total population of 100,000,000,000,000,000 humans on the habitable planets.
But of course each of the 100,000,000 habitable planets in the space empire should be able to build space habitats in its system and have a total population of at least one trillion or 1,000,000,000,000 persons on those space habitats. Thus the space empire could have total of 100,000,000,000,000,000 humans on the 100,000,000 habitable planets and another 100,000,000,000,000,000,000 humans living in the space habitats in the 100,000,000 star systems that happen to have habitable planets.
But what about the 9,900,000,000 star systems in the space empire which don't have habitable planets? Most of those should have planets, moons, comets, and asteroids, so it should be possible to build space habitats in those systems. So every single one of the 10,000,000,000 star systems in the space empire could eventually have thousands and millions of artificial space habitats and a total population of at least a trillion or 1,000,000,000,000 persons on those space habitats. So the total population of this hypothetical space empire could be 10,000,000,000,000,000,000,000 persons, spread over 100,000,000 habitable planets and countless gazillions of space habitats in 10,000,000,000 star systems.
So any "galaxy spanning" space empire should have a very, very, very, very complicated government.
Part two: The space navy of a galaxy spanning government:
For example, suppose that each star system has a one star admiral in command of the defenses there. A two star admiral might be in command of the defenses in ten star systems, a three star admiral might be in command of the defenses in 100 star systems, a four star admiral might be in command of the defenses in 1,000 star systems, a five star admiral might be in command of the defenses in 10,000 star systems, and so on and so on.
And when a feet of space battleships is assembled, a one star admiral might be in command of ten space battleships, a two star admiral might be in command of 100 space battleships, a three star admiral might be in command of 1,000 space battleships, a four star admiral might be in command of 10,000 space battleships, a five star admiral might be in command of 100,000 space battleships, and so on and so on up to the commander of the entire fleet.
In E.E. Smith's Lensman series, the main battle fleets of galactic governments had millions of space battleships.
So I was rather shocked by the Star Trek: Deep Space Nine episode "Sacrifice of Angels" depicting an important battle in the Dominion War with only 600 Federation ships vs 1,200 Dominion and Cardassian ships. The fleets should have been tens and hundreds of times as large. And it was equally shocking to see Sisko, a lowly captain, in command of 600 Federation ships. This seems like a clear case of "Writers Cannot Do Math":
https://tvtropes.org/pmwiki/pmwiki.php/Main/WritersCannotDoMath1
So any space government that rules a galaxy, or a significant piece of a galaxy, is going to have a space navy with many, many, many different Admiral ranks. in the current US navy there are only six officer ranks below the Admiral ranks: ensign, lieutenant junior grade, lieutenant, lieutenant commander, commander, and captain, and only four admiral ranks. But in the space navy of a major galactic power, the admiral ranks should greatly outnumber the other officer ranks, and might even greatly out number the other officer ranks and the enlisted ranks combined.
Part Three: the size of the civil government of a galaxy-spanning empire.
Suppose that some of the solar systems in the galaxy-spanning empire have artificial space habitats. We might suppose that the ruler of a single space habitat might be called a habicrat. A habicrat might be elected by the people of the habitat, or a hereditary noble, or appointed by higher authority. Maybe there are all three different types of habicrats ruling habitats in each star system.
Suppose that the ruler of ten habitats is a habicrat of Habicrats, or a habicrat to the second power, and abbreviated HC2. The ruler of 100 habitats might be a HC3, The ruler of 1,000 habitats might be a HC4, The ruler of 10,000 habitats might be a HC4, The ruler of 100,000 habitats might be a HC5, and so on and so on. There could be millions of artificial space habitats in the system, so there could be one or more rulers of a million habitats, each of them a HC6.
And possibly the ruler of an entire star system, whether elected, hereditary, or appointed from above, might be called a stellacrat. Then the ruler of ten systems would be a stellacrat of stellacrats, or a stellacrat to the second power, abbreviated SC2. The ruler of 100 systems would be a SC3, The ruler of 1,000 systems would be a SC4, The ruler of 10,000 systems would be a SC5, The ruler of 100,000 systems would be a SC6, and so on and so on. So the ruler of the entire space empire of 10,000,000,000 star systems would be the equivalent of an SC11.
Suppose that in the space empire agriculture is replaced by technological synthesis of food. In that case the space empire might have a Department of Food Synthesis as its equivalent of the Department of Agriculture in the USA. And if that Department of Food Synthesis has offices on every planet and on every artificial space habitat, it will have to have a hierarchy with many different levels of managers to manage those offices.
Part Four: The title of the monarch.
The Op talks about the "royal family" of the vast space empire "spanning the galaxy".
I find it really hard to picture a government of a significant part of a galaxy with a mere king as the monarch.
If every single star system in the space empire had a king (elected, hereditary, or appointed) as its ruler, perhaps each group of ten star systems would have king of kings, or king to the second power, as it ruler, abbreviated K2. A group of 100 star systems would be ruled by a K3, a group of 1,000 star systems would be ruled by a K4, and so on and so on up to the ruler of, in my example, 10,000,000,000 star systems who would be the equivalent of a King to the 11th power, a K11. And I think the highest ruler of such a vast space empire would be an emperor.
My answer to the question: Imperial Kingdoms?2
Shows that there are many examples of kings, great kings, kings of kings, etc., being subordinate to higher rulers.
Thus your galactic realm might have many nobles and many royal families subordinate to the monarch who might be an emperor.
Part Five: How to select officials.
Thus the galaxy spanning space government should have many levels of administration. And how should the different levels of military and civil officials be selected?
Shouldn't someone pass tests and show skills in a lower rank before being promoted to a higher rank? But what is the minimum amount of time someone can spend in a position before he shows that he is suited for promotion to the next highest position? And how long is the average working span of adult humans in your future society?
If the average working life of an adult human in your story is divided by the usual amount of time someone has to spend in a position before being promoted to the next highest position, how many promotions will the average official get in their working lifetime? And how does that average number of promotions compare to the total number of ranks in the official hierarchy?
If the official hierarchy has many more ranks than the average official can be promoted do during their career, promoting someone from the lowest rank to the highest rank during their career might be impossible.
So in a non democratic monarchy, every single position could be hereditary. So small communities would be ruled by hereditary lords who are vassals of hereditary counts who are vassals of hereditary dukes who are vassals of hereditary kings who are vassals of hereditary kings of kings who are vassals of hereditary kings of kings of kings who are vassals of hereditary kings of kings of kings of kings who are vassals of hereditary hereditary kings of kings of kings of kings of kings, and so on and so on, up to the hereditary emperors.
But if the OP wants an at least partially democratic, and at least partially bureaucratic, form of government, the space empire will have many ranks of appointed officials, as well as a considerable number of elected officials, so many positions must not be hereditary.
So possibly, whether the government is an absolute monarchy or is a democracy with a purely ceremonial monarch or is anyway on the broad spectrum between those extremes, members of different classes might start their official careers at different levels of the official hierarchy.
Common citizens or subjects might start at the lowest level of the hierarchy and be promoted five to ten times during their careers. Members of noble families might start their careers a few steps above the lowest level and be promoted five to ten times during their careers, thus retiring at higher ranks than commoners. Members of royal families might start their careers a few steps above where nobles start and be promoted five to ten times during their careers, thus retiring at higher ranks than nobles. Members of the families of kings of kings might start their careers a few steps above where members of royal families start and be promoted five to ten times during their careers, thus retiring at higher ranks than members of royal families.
And so on and so on up to members of the imperial dynasty, who would start their official careers at a level higher than anyone else and get promoted five to ten times during their careers and thus retire a higher ranks than anyone else.
How fast someone gets promoted, so whether they are promoted five times or ten times during their career, should depend a lot on how well they do, so that more competent persons should be promoted faster.
And there should be programs to enable exceptionally promising persons to be start their careers at higher levels than normal and to reach higher positions than normal, and for noble, royal, etc. persons who fail badly to be demoted to lower ranks.
And of course, commoners have become noble in even the most stratified societies. Noble families occasionally die out and thus new noble families are needed in order to keep the existing noble families from becoming too powerful. And in a expanding society there should be more opportunities for commoners and for nobles in each generation.
And democratic institutions are quite practical on a local scale, even if the central government is less democratic. So every swarm of artificial space habitats, or every habitable planet, could have several levels of democratic government. So democratic governments should function well and control most matters important to the people, up to the level of solar system wide government.
I'm not so certain whether democratic forms of government could function well on the level of a galaxy spanning space empire. I'm also not certain that monarchical, aristocratic, feudal, bureaucratic, communist, fascist, or any other types of government could function well on that scale.
But the OP assumes there is a functioning galaxy spanning government with a mixture of democracy, monarchy, aristocracy, and bureaucracy, and it is certainly possible that some mixture might work in the higher levels of the galaxy spanning government.