Depends on how it is built. Its quite possible to make anything robust enough to withstand an EMP, and EMP threats are primarily to devices using low current.
But you can overload it`s systems and that would leave a ship so armed, unless it had good old fashioned guns and missiles, defenseless.
Is the national grid lower power device?
I seem to remember someone saying those power lines carry a hell of a lot of voltage, were they wrong?
Oh, and those power-grid transformers, wouldn`t they use something similar to step up voltage for those rail guns? Perhaps high power capacitors too? And lets not forget the generators.