Yeah..... We kinda solved this problem in the late 1800's. Overhead electric or powered third rail (depending on need) is really peak public transportation when it comes to cost and efficiency over time.
People always harp on the infrastructure cost when it comes to rail, but turn a complete blind eye on extreme cost of things like road maintenance and need for lane widening caused by everyone driving huge ass half filled busses everywhere.
Road maintenance is one of the largest expenses for most states in the US, and it's largely so much worse than other countries because our dependency on the trucking industry. We're all basically constantly subsidizing the trucking industry at great cost instead of funding adequate public rail.