Would a Federation warship like the Defiant out gun a Star Wars Star Destroyer? Who has a bigger armada? Who has the tactical advantage? Don’t forget that The Federation includes the Klingons, who love warfare and have fast, agile, heavily armed ships, with cloaking devices, and the Vulcans with superior logic and tactical planning.
There is literally an episode of TNG where they use that very thing as a threat to some colonists they need to move, and then go on to say that the incoming aliens that want the humans gone are even more powerful. Their ability to glass a planet with a single ship is mentioned *quite a bit.
As for the shields in Star Wars: They’re only good if the ships are near enough to a ground based generator that is vulnerable to attack. In a straight up space battle not near a planet, the empire is kinda fucked. Plus the shield generators in Return of the Jedi at least don’t seem to be shielded themselves… So lock photon torpedos and boom.