I would expect electronics
to be better protected but not perfectly and probably not as good as can be arranged.
My feeling is that you can’t get perfect protection on a boat
Best protection includes a boat would be electronics wrapped in an insulator in turn places inside a metal box, preferably a steel
box. The box needs very tight gaps to the lid or high frequency energy will leak thru.
Steel is preferred over aluminum
because it will divert the magnetic as well as electrical
I have my backup gear
in an ammo box from Costco.
A steel boat does a better job of guiding currents around the interior
but it has large openings (ports and companions) that provide an ingress path for high frequency energy.