Take an electrified rail network, pave it over to resemble a tramway track and add on/off ramps wherever they might be useful. Figure out an economic mechanical design that would allow a computer to precision-drive along the rail for on the fly mode switching. Which is an extremely limited task scope where computers would excel, very much unlike the almost-AGI requirements of full self driving. Mandate strong requirements for access to that network including a small minimum range of battery-autonomous operation so that you don't have to reach the atrociously high number of availability nines a conventional rail network needs to avoid total schedule collapse.
A lot of this is because railway signalling operates on a brick-wall principal: it is constantly assumed the vehicle in front could come to a dead halt instantaneously, whereas most road situations assume if you can match the braking performance of the vehicle in front with some margin.
The railway case is safe for the trailing vehicle in the situation there's a concrete block on the track ahead, the road one is not.
That applies to old style -though still in common use- signalling. CBTC (every railway should use, but very few uses it) has similar, or even tighter, margins to road signalling.
Drivers feel safe to attempt brake matching (they fail often enough) because road code assumes that you never go fast enough to make stopping distance exceed visual range. Even if that rule is routinely broken the brake-match distance stays comfortably within visual range (stoplight waves travel upstream). In rail, everything happening within visual range is basically too late to even bother and this is entirely a consequence of braking performance.