Yes. The cost is often evaluated, and it's being done more and more now. Electric Mobility Canada is one of the ones working on the issue.
You are absolutely right that an electric car has an environmental cost. That said, the overall environmental cost of an electric car is much lower than that of a gas-powered vehicle. At worst, there is a 20% savings in greenhouse gas emissions. That would be the case of an electric vehicle in Alberta that is 92% powered by electricity derived from coal and natural gas. That will improve, however, with Alberta phasing out coal-fired power plants by 2023, replacing coal with natural gas, a renewable energy. At best, the environmental savings is 60%, 70% or even 80%.
You mentioned the use of rare earths to manufacture electric car batteries. That is a myth being perpetuated on social media. Electric vehicle batteries do not contain rare earths, but all anti-pollution systems in gas-powered vehicles do. In fact, that is the reason for the current rash of thefts of catalytic converters in Quebec and elsewhere.
Electric vehicles do have an environmental cost, but it is less than that of gas-powered vehicles. Electric vehicles are not the only way to reduce our environmental footprint; they are one of many ways.