>Diesel locomotives (train engines) and many ships use diesel generators to power electric motors -- this setup is useful for applications where high torque is required at low RPMs (even down to 0 RPM)
Few ships are diesel electric. It's inherently fairly inefficient compared to mechanical power transmission. Diesel electric is mostly used in locomotives and heavy mining equipment where a mechanical drive-train would be overly complex or inconvenient to package (imagine the drive-train for a freight locomotive) but the machine enough driving that hydraulics is too inefficient (whereas something like a mining shovel doesn't do much driving and the market).
>Diesel-powered trucks, tractors, and heavy equipment
For stuff that's small enough to transport on a semi and doesn't need to go highway speed it's really hard to beat hydraulics for low cost and low cost of ownership. A slightly more efficient drive-train doesn't really make it far up the important features list when you're gonna be pushing dirt and your maintenance schedule and how hard on equipment your employees are dominates your longer term cost of ownership. Indoor stuff will go more electric but it's been electric for awhile, it'll just get better/lighter.
>Military vehicles
Not gonna happen anytime soon except some specialty applications (small inshore subs come to mind, SDVs are already electric). Military stuff needs to stay light for a variety of reasons and the last thing they need are a bunch of volatile batteries that need to be protected (whereas a fuel tank of diesel can act like armor to some extent).