Not sure how diesel trains are "worse". When you have a 1000-mile line through the middle of nowhere, it's probably better to bring the power-plant with the train, instead of having 1000 miles of wire and electrical substations sitting idle most of the time. (Overhead wires also interfere with tall railcars, like double-stack container trains.)
For commuter trains, though, I am not sure why we use diesel. Lower upfront cost is my guess, which is kind of a shame. (The US has big problems with buying proper infrastructure. Much better to spend $100 million over 10 years and provide mediocre service than to spend $50 million in one year and provide excellent service for 10 years. Funding anything other than roads is politically unpopular; trains are "noisy" and we don't want more of them. Yeah... some day I will move to Europe or Japan...)
For commuter trains, though, I am not sure why we use diesel. Lower upfront cost is my guess, which is kind of a shame. (The US has big problems with buying proper infrastructure. Much better to spend $100 million over 10 years and provide mediocre service than to spend $50 million in one year and provide excellent service for 10 years. Funding anything other than roads is politically unpopular; trains are "noisy" and we don't want more of them. Yeah... some day I will move to Europe or Japan...)