Map of federation territory in their respective galaxy
Map of the Imperium after the heresy.
Size comparison of ships has already been posted, but the biggest star trek ship designed for war would be tiny in the 40k verse.
The point about 40k ships and tech being resistant to hacking hijinx due to their archaic nature is an interesting one...So there is an advantage to having a ship's guns being manually loaded and armed by thousands of crew after all!
Also how would the federation deal with psykers anyway?
Finally i remember that DS9 episode about a bunch of federation marines and how they were breaking down and suffering extreme stress under conditions that would seem laughable for a standard imperial guard trooper... Oh lordie, a planetary invasion against a federation world would be the most one sided thing ever, no matter what kind of technological wizardry they pulled (and if they were capable of doing such things, why didn't they show it in the dominion war?), the imperium simply wouldn't care about losses or setbacks and continue to drown the planet in fanatical troops for whom fighting the federation troops would be the closest they ever got to a holiday.
The biggest weakness of the 40k side would be the reaction time, they are usually on the defensive and struggling to hold on all sides against all manner of nightmares and thus take time to shift ressources around and get their stuff together to push back the next intergalactic menace..Except the federation is unlikely to be the aggressor and really capitalize on this, likely only realizing their mistake far too late when the first actual imperial armada is on their way.
Honestly why do people hate star trek so much that i frequently see it bought up in a universe vs universe fight :/
It's not even 40k, but things like Star Wars too, Star Trek is simply not a setting where galactic warfare is a primary focus and is more about exploration and negotiation. Deep Space 9 was a bit of an exception but even then, that just goes to show how sucky the federation are in war when they had to be bailed out by their protagonist conveniently being a prophet of a god like race blessed with super powers that allowed them to completely wipe out the enemy fleet during transit that would otherwise have doomed them.
So yeah, other then god like entities like the prophets or the Qs, the star trek setting doesn't really have anything crazily OP in comparison to other sci fi settings, thus would usually get flattened in short order.
Addendum_Forthcoming said:
Plus given teleporters and cloaking devices are commonplace, the Federation totally one up the Space Marines in surgical strikes. Not only that but automation. A single industrial replicator can feed and arm an army ...
The best ships in the IoM are good because they are old. Whereas the Federation can mass build warships that are guaranteed to outgun competition as time goes on.
Even with teleporters, the federation would never come close to being effective shock troops to rival the Astartes. I'd love to see an away team beam up on an imperial ship only to be met with thousands upon thousands of crew men. With the sheer size and complexity of imperial ships where even the crew themselves don't fully know the layout of their ships, like hell your average red shirt would know where to go even if they go for obvious power sources.
Part of what makes Astartes the perfect shock troops isn't just their means of transportation, but them being walking tanks armed with weapons that function like rapid firing rpgs. And if that's not enough, they are capable of ripping any human sized foe limb from limb.
Giving a redshirt squad teleporters and beaming them upon the bridge of a 40k ship, or its reactor rooms or w/e, isn't likely to go in their favor, crews in the 40k setting deal with much worst.
Industrial replicators would be relevant in prolonged conflicts but i just don't see that happening, and would only just draw the curiosity of techpriests and inquisitors so they can get their hands on this delicious piece of tech/destroy it for heresy as the case may be.
And even replicators ain't a guaranteed solution, and relying on them only makes federation troops soft in comparison to their 40k counterparts.. That DS9 episode i was talking about, siege of something something, they didn't have replicators for w/e reason and were going absolutely crazy under "harsh" conditions that would seem laughable for any 40k guardsman.
Finally the federation doesn't have the ability to build ships on a scale that counts, their losses at Worf 359 or whatever that number was, was deemed a disaster...And the fleet they gathered to defend the earth against a single borg cube in the first contact movie was pitifully small. They won't be producing thousands of ships quickly, even producing ships in the hundreds would be a massive challenge for them. Haven't looked up how many shipyards the federation has or how fast they can make ships, but clearly they ain't gonna be mass producing fleets based on what i've seen in DS9 or the first contact film.
As time goes on, yeah they could make massive leaps of technology..But they won't have that time, their territory is simply too small and their standing army/fleet is too tiny to effectively stall and blunt an imperial advance to a degree significant enough to buy the time that is needed.