It's not just about generation. The generated electricity has to be transmitted for 100's of kilometres before reaching the railway line. If all the transmission losses are included, then it is very likely that an eloco might be less efficient than a dloco. This however, is not an easy thing to evaluate as there are several factors at play here.
Even Hydro power still harms the environment. It may be clean without any green house gas emissions, but large hydro projects can irreversibly damage the local ecosystems and displace many communities, and increase land slide problems. The scale of the project must be carefully planned.