"Just invest in rail."
No, it's not that easy. Trains are slow to get started, they need a significant amount of time to stop. Most trains weigh way more than a truck with full load. But trains need to be managed carefully. Enough distance between the trains, a quality management system for switches and signals, good trains, good personnel.
Before that, you need to design your network such that it's attractive enough for people to use it. With public transit this generally means: put stations at places where people want to get on or get off or want to transfer to other modes of public transport (such as buses, subways, trams) which can bring people closer to their final destination.
And note that this will change over time, but your rails can't change over time. This is the peril of rail for intracity transit.
Rails make a lot of sense in ultra-dense areas (think Manhattan, *maybe* downtown SF, but not any of the rest of the Bay Area, etc.), because the roads can't handle even a fraction of the passenger volume.
Rails also make sense for long-distance travel. If you're traveling for several hours, you probably don't want to drive that, so it is worth the inconvenience of not having a car at the other end. Also, if the trains are fast enough for their average speed to exceed the average speed of a car, then after two or three hours, you've probably broken even with the extra travel time required to get to and from those fixed endpoints.
But for the most part, rail *doesn't* make a lot of sense, because they're too much slower than air travel for long distances, and they're too much slower than cars for short distances. If you really want rail to work, we need 250 MPH (minimum) bullet trains from city to city so that they are competitive with airplanes. And provide ample parking at the termini.
All of these modes of public transport need to be efficient, arrive at least twice (preferably more) per hour throughout the day, be safe and clean.
Twice per hour makes a transit system borderline useless unless you are traveling for multiple hours. Your average latency is half of that, so that means on average you will waste 15 minutes waiting for every train. That means to break even, even before factoring in the extra time to get to/from the station, you need to save a whopping 15 minutes by using the train. And if you have even one connection, that makes your median latency thirty minutes. When you're wasting half an hour just waiting for the train to arrive, you're not only uncompetitive with driving; you're starting to be uncompetitive with bicycling.
Successful transit systems run avery 3 to 5 minutes during rush hour, and no more than about once every ten minutes late at night or on weekends. If you can't keep trains running at that frequency, you aren't dense enough to need a transit system, and you probably will regret putting one in. You'll end up repeatedly reducing the frequency to keep the trains at high enough occupancy to be worth doing, and then you'll be confused when ridership drops because nobody wants to wait that long for a train, and eventually you'll end up with a massively subsidized waste of taxpayer dollars like VTA.