The most powerful creatures in the ST universe seem to be the energy creatures, of which there are many. The original series had quite a few of them, and the Q are possibly an energy gestault, but they can strip individual members of their powers, so they have a corporeal element, and don't just simply shape-shift into apparently corporeal forms as the ones in the original series did. We really know very little about the Q, and they most likely have an energy lifeform as their source, but they may have absorbed other creatures into their gestault.

In spite of their seeming omnipotence, however, even the energy lifeforms are not gods and do not have limitless powers. They only seem to. But they are highly sophisticated, extremely powerful, and most of them are mercifully wise. But not all. Never forget the malevolent energy being in "The Undiscovered Country" who tried to pass himself off as God, but who needed a spaceship for long-distance travel. I suspect none of the energy beings can travel great distances unaided.