The problem of long shafts bit overblown.
They are not that heavy ,they need to be only hollow tubes.
The USN selected electric drive in the 1910s because it was the more mature reduction technology. The Washington Naval Treaty of 1922 substantially limited the max displacement of capital ships. The extra weight of electric drive together with the maturation of reduction gears made them the inferior solution.
Those 120 escort destroyers built in 1943-1944 used electric drive because the gear manufacturing capacity was insufficient to keep up with demand.
True, but those are not the only relevant parameters for a warship. In no particular priority: survivability, acoustics, fuel economy are three parameters where electric propulsion typically has the advantage.Issue is simple, the ship has a cost ,weight limit, and a desired maximum speed, and the electric propulsion usually has inferior characteristic if all three considered compared to direct geared drive.