It's probably not possible to know how the specific apparatus in that photo works, but it appears that several inventors were trying to automate traffic counting at the time using sophisticated Rube Goldberg types of machines from the pre-transistor age.
You can see some (all?) of them listed in this patent. I briefly go through some in what follows. The years quoted are the claim dates, rather than the year the patents were granted, since this is what matters to get a feel of what might have been out there. I'm paraphrasing their content more often than not when trying to shed light on how they work.
This patent seems to be about detecting traffic, rather than counting it. For instance ahead of a curve to light up a warning sign that prompts drivers to slow down.
I found it quite interesting regardless, in that it relies on the iron in vehicles besides it to disturb a magnetic needle, thereby creating an electric contact. It also goes through various methods that seem to have been in use back then to do the same type of things, and briefly explains why they are fragile as it introduces why that method is better.
This patent aims at actually counting traffic.
Judging by the description, the vehicle detection device below seems to rely on the vehicle's weight applying pressure to bring the wire in each strip in contact with another wire (under them?), thus creating some current.
(Aside: seeing how piezoelectricity was discovered in the late 19th century I'm a bit surprised that the inventor went with this highly mechanical and probably fragile option rather than some piezoelectric material to get a similar effect.)
The patent then goes on to describe a magnetically actuated counting device that keeps track of the current count and produces a printout of the current reading on a tape or the like at a given interval.
This next patent describes another type of counter.
It seems to rely on a light beam which is focused on a light sensitive cell. When a shadow is thrown in the cell, a circuit is made. It also seems to describe another a treadle switch that can be used to the same effect, and how this can all be used to count moving vehicles. It explicitly doesn't bother describing the counting mechanism, referring the reader to "a pair of Veeder or other suitable accumulative counting devices". The Veeder in there seems to reference a mechanical counter made by a company called Veeder-Root (a bit like googling has become synonym for using a search engine).
As the name suggests this patent describes a road strip. The mechanism seems very similar to the one further up from 1933, and it explicitly states that it's a continuation of the latter.
The following are three more pre-transistor age patents of potential interest, which I haven't gone through but which you or some other reader might find interesting.