The gas tax doesn't take time (or supply and demand) into account. Driving during rush hour should cost a lot more than driving at 3AM on an empty street. Sure, you use more gas sitting in traffic, but it doesn't make that much of a difference.
Tesla can solve this. They know when and where the car was driven, and each time it's charged, the charging station can interrogate the car and compute the appropriate congestion surcharge.