Well The star wars jedi order, republic, confederacy and empire are all defeated and destroyed but not by brute force but due to manipulation, will of the force and other things that are a running theme of star wars.
Warhammer 40k Empire of the man is never really destroyed from my knowledge and last far longer than any major government organization do in star wars, so it is more successful.
In terms of military, it look very loopsided towards empire of the man who fought against all kinds of enemies who are far beyond anything the star wars organizations have to fight. Even like the jedi is not shown to be particular strong, like Battle of Geonsis they suffer heavy casulties to battle droids who are potrayed as being pretty weak and there are only about 10 000 jedi, that is similar to a space marine chapter who would probably destroy the jedi order in a pretty one sided battle.
The clone wars series follow like the best of the jedi order upcomming talents with characters like Anakin Skywalker and Ahsoka Tano and those still struggle against foes significantly weaker than space marines and even the jedi masters also struggle with maybe the exception of Yoda but even he has limits. Maybe if the whole jedi order was made out of talents like Anakin Skywalker and Ahsoka Tano and at their peak and not the 19-22 and 14-17 versions we see them in the clone wars, in such case the jedi order may be able beat a single space marine chapter. So if the jedi order need to be filled by the top 1% of the top 1% at their peak to have some good odds against a single space marine chapter and that is the best "military" units of each side, I get feeling it will look very bad for the star wars organizations when you actually compare the regular forces and navies.
Just the fact by the start of the clone wars two of the absolute strongest jedi was teenagers, one as young as 14 should give a telling what shape the jedi order actually was in.
40k understands itself well. Star Wars is at its best when it does the same, but it doesn't manage it as consistently.
Well I don't know much about 40k beyond various games I've played to it. But yes for star wars there are many inconsistencies, which is why I mostly use the movies and the rebels and clone wars series as those are relative consistent with each other and don't go into making the characters completely unbeatable and overpowered which would more or less ruin the stories and attachment to the characters. The clone wars series is probably the best star wars I've seen and it we see the 3 main characters/heroes Obi Wan, Anakin Skywalker and Ahsoka Tano as clearly flawed people who struggle in many ways and clearly very beatable.
Also a good observation and that applies to both universes. The real question is who would win a fight between a master Jedi/Sith and a master librarian/adeptus mechanicus?
Libarian/Adeptus mechanicus would most likely win by a very far margin based on my knowledge. Jedi masters have been defeated and killed by much weaker opponents. Sith probably do significantly better but those seems to be portrayed as significantly stronger combatants than jedi with only the absolute peak of the jedi being comparable but insignificant in numbers. The gap between the top combatants of the jedi and sith and the rest is potrayed to be huge and I guess maybe there was only like 10-15 top combatants active at any one time in star wars universe, maybe there are a lot more given the movies and such only cover limited set of characters.
1. The Star Wars Empire is not a bunch of idiots who constantly look like fools
2. The IoM may have to toy with adding heretical technologies to their mix in order to take on the SW Empire.
I would add in a third assumption: that there are no characters (Luke, Leia, Han Solo, etc) that would have
plot armor that would give stormtroopers a debuff on their accuracy. and Palpatine not high on laughing gas causing him to
catch the idiot ball.
As number 4 I would say the star wars main characters tend to be prodigies and very exceptional. In the clone wars, Ahsoka and Obi Wan are prodigies and Anakin is the Chosen one and also a prodigy. In Rebels, Erza, Hera and Sabine are prodigies and maybe the members are that as well. In The Star Wars movies, Luke, Leia, Rey, Han and probably Chewbacca are all prodigies. A bunch of other characters such as Yoda, Mace Windu, Darth Maul, Darth Sidious, Count Dooku, Padme, Boba Fett and so on seems to be prodigies.
The stormtroopers, pilots and so on are your normal people and thus at a significant disadvantage against the characters mentioned. Even the average jedi knight would be completely outclassed against many of those characters.
Plot armor is also a major factor (well in star wars you can simply say it is the will of the force that the characters survive to they have completed the objective) otherwise they probaby all be dead long before they actually died.