Some countries "destroyed" their own railways systems in favor of roads, buses and trucks. Progress they say. It's sad.
for freight there were different considerations and electric didn't have the needed power.
Steam was more fuel efficient than diesel when it was replaced. But a diesel engine could start in less than a few hours, and needed one less person on the crew so it was cheaper overall.