I would imagine that by the 24th century, ‘hobby’ classic cars would run on some form of environmentally friendly and sustainable hydrogen combustion engine, with their only emissions being H2O/water vapour. They may even burn vegetable oil? I guess that all of the Earths petroleum oil reserves would have been used up by the 24th century, anyway. Perhaps the Federation set up oil fields on other planets though such as Tellar and Andoria.
I doubt that everybody would have Tesla’s, but I could be wrong. The batteries are not easily recyclable and would not meet Federation standards unless some new technology was introduced to make them more environmentally friendly and sustainable?