So far battery manufacturing facilities and raw materials required for an electric car rollout with equal impact to public transit simply don’t exist, creating the infrastructure for these facilities and expanding mining operation to meet up with the demand of batteries for all these electric cars might take 5-10 years with heavy government involvement, including subsidies to manufacturers amounting to orders of magnitude more than public transit infrastructure would need.
A realistic rollout of electric cars of sufficient magnitude is north of 2035. A realistic rollout of public transit infrastructure is 2030 with benefits starting immediately.
However, if you can get governments to finally roll out lots more public transport, definitely go for it. Preferably with something electric, we don't really need more fossil on the road.
In my country of origin the public transit system is horrendous where politicians picked subsidizing electric cars (despite policy experts telling them what terrible climate policy that is [data exists too on that]) with minimum funding going to public transit expansion. And even there—with the exception of covid—public transit usage is on the rise.
In my current home city of Seattle a lot of funding has gone into expanding and maintaining the public transit system and usage has increased very dramatically as a result.
The reality is that electric cars are not a good climate policy by any standard. Even a lackluster implementation of public transit expansion beats a solid program of subsidizing electric cars.