I wonder, is it possible and economical to switch majority of all transport to rail? Replace trucks with freight and cars with trams and bikes. Of course there will always be needed some cars for emergency and rural but everything else be rail? Just wondering how much it would cost compared to car infrastructure.
You still need trucks for last miles delivery.
You can reduce big trucks delivery by making the logistics hubs near the rail (but this would take a lot of time for the infrastructure to update), you'll end up with smaller trucks.
The good news is that last miles trucks cause less problems: electric trucks works for last miles delivery, their count is way smaller than the car, and they don't need to be as big.
For example, small trucks have special pass to deliver in piedestran areas.
You can reduce small trucks count by doing delivery with cargo bikes (that what "La Poste" do in a lot of cities in France), but you will still need small trucks to deliver heavy things like flour to the baker.
I am not sure there is any superior technology to a box truck with a nice heavy duty handcart and powered liftgate (or easy loading docks). Maybe a smaller box truck with smarter thought about what actually needs to move around, but the box truck is kind of the optimal solution to the problem of moving stuff around at a certain level. Sure it would definitely be sweet to go straight from rail to box trucks for local-ish delivery though.
In a walkable city, the grocery stores are way smaller, rails isn't really good for small delivery.
Small cargo car are also needed for some jobs.
But again, these are infrequent uses of the road and those sort of usages are usually allowed inside pedestrian area.
But there's also a bunch of reasons no ones doing it. Even if we disregard the enormous work to lay tram tracks on most roads, tracked vehicles have the major drawback of not being able to go around each other. One unloading tram shuts down the whole line. Also: How much different is a tram from an electric truck? Less particulates from the wheels, but that's pretty much it.