The keyword for the problem you're talking about is the "long tailpipe theory." [1] I was just reading Wait But Why's article [2], which concluded that the overall greenhouse impact will still be lessened by using electric cars over internal combustion.
I didn't dig into the sources enough to conclude that it's truly a better option, but those articles are a good place to start.
[1] https://en.wikipedia.org/wiki/The_long_tailpipe
[2] http://waitbutwhy.com/2015/06/how-tesla-will-change-your-lif...