Certain expressions are inherently foreign to Hebrew, because they are absent in the Jewish tradition. Gates of Hell is one of them: the notion of Hell as a terrible underworld of fire and brimstone is really founded on the Greek idea of Hades, with subsequent embellishment by the Christian Church during the Middle Ages (and Dante, of course), in a bid to keep congregants in line.
Not surprisingly, therefore, the expression Gates of Hell shall not prevail is from Matthew 16:18—i.e. the New Testament, not the Hebrew Bible. (The original Hebrew translations of the New Testament have been lost, so we can only conjecture what they were, or have a stab at it ourselves; you could also check out George Howard’s translation)
The closest notion in the Hebrew Scriptures to the concept of Hell was that, once a year, on Yom Kippur, the community would symbolically pile all their sins upon a poor goat (the original scapegoat), then kick it off the southern walls of Jerusalem into the Valley of Hinnom, to its death (in Hebrew, Gey Ben-Hinnom, or Gey Hinnom—hence the Christian gehenna).
Today it’s quite a pleasant valley, where the goat’s roll down the hill would be stopped by any number of trees and terraces, where it would pick itself up and scamper off happily, somewhat bruised and bemused, but none the worse otherwise:
In any event, the Hinnon Valley didn’t/doesn’t have any gates, and even if it did, the Hebrew for ‘Gates of the Valley of Hinnom’ (Shaarei Gey-Hinnom) may be a common modern expression of somewhere awful, but it’s not very poetic.
A better option is She’ol, which in the Hebrew Bible is where the dead reside—quite peacefully, as far as one can tell, until the End Days, when they all arise —and is not so much terrifying as mysterious and unknowable (although it was known occasionally to swallow up people—e.g. Isaiah 5:14.) Poetically, if you had to translate the word Hell in reference to gates, that would be the word to use, because it scans better:
שערי שאול Shaarei She’ol
—and it’s a little more dramatic than the prosaic shaarei mavet (‘gates of death’) which is the more typical epithet in the Hebrew Scriptures (Psalms 9:14 & 107:18; Job 38:17).
As for prevail—the standard translation is לגבור על (ligbor al) but in third person plural it’s yigberu—which metrically is a bit awkward. The word yukhlu is better—but it must be followed by who it is being prevailed against.
Putting it all together, and assuming you’re talking about ‘The Gates of Hell will not prevail over me’, that would be:
שערי שאול לא יוכלו לי | Shaarei She’ol lo yukhlu li
As for no weapon formed against me shall prosper—that’s from Isaiah 54:17, so no need to translate—it’s already there, in the Hebrew:
כָּל-כְּלִי יוּצַר עָלַיִךְ, לֹא יִצְלָח | kol kli yutzar alaïkh la yitzlaḥ.
Hope that answers your questions.
Live long, and prosper…