I thought the US Navy is going to use the Railgun technology (I’m not sure if it’s still in the developmental stage today). I saw the experiments on YT. Well, I guess cost-effectiveness matters the most.
They are continuing to pursue both technologies as they have different mission objectives. It looks like the LaWS is a point-defense system against air targets - currently drones but I am sure they are continuing to work on an anti-missile laser system to replace Phalanx CIWS. It will also be great against small surface craft. The electromagnetic railgun will be a medium-range anti-ship and land attack weapon system. For long-range over-the-horizon attack they will continue to have Tomahawk for land attack and Harpoon for anti-ship.
They use jellyfish because of the efficiency at which jellyfish swim. Higher efficiency -> longer times between maintenance, more power for other equipment, etc.