It depends more on your own use than the vehicle itself. Most old vehicles sit in garages most of the time as secondary vehicles. So extending the life of a ICE car vs. manufacturing another to do the same (light) workload is a loss. But if you're buying a vehicle to use as a rideshare or whatever for 8 hours a day, the beater is going to be much worse for emissions.
Yes, all of that can easily be boiled down to the efficiency of an electric motor versus a gasoline engine. The more miles you drive the faster you will offset any carbon from manufacturing.
BEVs on average currently take more energy than ICE to build but the difference is made up in a couple years because electric motors are so efficient compared to gas engines.