There will be legal issues that make this more complicated as it seems. For example, if there is a risk that the car tires get destroyed while the car is travelling at speed, this could lead to nasty accidents where people get seriously injured or killed, including innocent bystanders. And even if only the car tires get damaged, in many jurisdictions you don't get a right to damage somebody's car just because they broke a traffic rule.
Also of course it has to be absolutely failsafe that the device isn't triggered by anything else, like people or horses stepping on it.
So the use of such devices will probably be restricted to a narrow range of situations, e.g. law enforcement, used by trained professionals with clear procedures that minimise the risk to the offender and any bystanders and a risk assessment that justifies its use in the individual case (e.g. against terrorist attacks, or in a car chase where the driver has already endangered bystanders and must be stopped at all costs).
I don't think that the wish to stop a driver using a bike path is enough justification for endangering the driver or even just damaging their property.
All the measures (that I can think of) that stop cars from entering a path are passive and obvious, so that potential offenders can see and avoid them, like bollards or gates. Even automatic raising bollards need lights and warnings etc., they can't just pop out of the ground unexpected (not that it helps much, there are loads of funny videos on youtube of drivers following behind buses through bus gates and hitting the bollards...)
So you can stop cars by restricting the width (bollards, gates), but there's almost nothing you can do against motorbikes if there should also be access for (larger) bicycles, wheelchairs, buggies etc.
From a purely technical point of view, it would probably be possible to build a barrier that uses the weight of the vehicle, so motorbikes will be stopped but bicycles can go through.
An obvious solution is a deep trench across the path that is covered by a plate held up by strong springs. If anything above 200 kg drives onto the plate, it will tilt down so the vehicle ends up in the trench, while everything lighter can pass. Or it tilts down a bit and exposes spikes that damage the tires.
However, while this would technically be possible, you'd probably get into real trouble for all the reasons above. And it gets more complicated if there's a risk that a horse or cattle steps on it, or a hiking group of several people.
With modern technology it should be possible to have a smart camera that recognises the type of object that is trying to get through and can open or close a gate accordingly. If it recognises a car or motorbike, it simply locks the gate, but opens it for any other user. I assume this will be legal, but expensive and will need much maintenance.