There are two options:
1. A dongle with GPS, mobile connectivity and some other features would be installed to all vehicles. This makes it easy to implement the system, but would be a logistical nightmare.
2. The government could receive information directly from the manufacturers, but that a) can be a privacy nightmare, b) would work only on cars manufactured after 2016 or so, and c) is insanely complex to implement, due to differences and incompleteness of various manufacturer's API implementations (source: I worked on one such system).
One solution that comes to mind is to use the same technology that already exists for traffic violations: when a vehicle enters or leaves the motorway it would get its licence plate scanned, and a fee would be applied to that vehicle's account. The owner can then be charged in a number of different ways - immediately, or periodically, or after a certain threshold was reached - whichever is the most practical.