The reason is that it is much more cost effective to generate electricity and use electric motors to drive the wheels than to build a transmission and clutch to handle the power.
Diesel locomotives are typically 2000 to 6000 horsepower, but have a limited RPM range. They would need a lot more gears than a car which has a transmission with 3 to six gear ratios. And, the gears would need to be much larger than automotive gears to handle the loads. Transmissions also have internal losses. These are typically low, but even 1% loss of a few thousand horsepower is a lot of heat, which is where the power loss shows up.