Far easier than maintaining a complex system to track every drivers' location over time. Ugh.
That seems like something that one ought to be allowed to opt out of in favor of an odometer reading; I do something like 99% of my driving in my home state, and would rather just go with an annual odometer reading and maybe slightly overpay on my road taxes than have a tracking device in my car.
Solution? Increase the cost during those 2 hours such that fewer people choose to use the road during those hours. You can give poor people cash and they can decide if it's worth using that road during the times with higher congestion, but the problem of exceeding a road's capacity along with the inability to build infinite lane roads is separate from income/wealth gaps.
The drywaller has every right to sit in stop and go traffic with the investment banker.
Congested roads have externalities such as the congestion backing up into side streets, rubber banding the congestion along the rest of the road, and extra use of brakepads/fuel energy to stop and go.
Spending time in congestion also adversely affects lower paid people because the cost of their time spent in congestion is implicit. If it was made explicit via tolls, then employers would have to pay better to get them to their workplace at peak congestion times.
Not that I support this initiative at all, but your suggestion misses some key issues.
The second best solution if you must tax miles driven is to mandate new cars include short range Bluetooth readable odometers and let users electronically submit this data to oem. While we are at it car electronics should be mandated to be able to perform this task without giving your contact data to the fuckin car.
I'd like to think it's because EV proliferation makes the gas tax too regressive but I'm not that good at lying to myself.