Sure! But that's not a silver bullet.
Decarbonization is a multi-prong solution and switching everything over to public transportation would take decades. It takes time to create the infrastructure and generations to change minds. Investing in public transportation, bike infrastructure and electrifying our cars are all necessary for our goal to lower green house gasses.
Perfect is the enemy of good
More than 20 years, peak car ridership occurred in the 1970s which was close to 80% of urban transportation done by car. That number is now down to 19% of all urban transportation done by car.
Amsterdam also had backing from the public to transition to bike and public transportation.
Absolutely we should invest in public transportation! And you are right that cities have decided to create public transportation, and then did! But it took a decade plus to plan, build and implant the new system. That's also ignoring the millions and billions of dollars needed.