How to mount electronics on a vehicle chassis safely
Avoid ceramic capacitors and ceramic components for applications under environmental conditions that include vibrations and shocks. If you can't avoid them, choose components that use materials or constructions techniques targeted to minimise the so-called "microphonics". Also, use microphonics minimisation design strategies on your own.

Microphonics is an unwanted behavior due to the piezoelectric effect of ceramic materials. Usually, it will manifest itself as spurious voltage burst when the component is subject to mechanical vibrations or shocks. Obviously, it can wreak havoc in your circuit, upsetting digital circuits and/or triggering switching in analog circuits.

Apart from microphonics, electromechanical devices (relays, swtches, etc.) can suffer upsetting under vibration/shock.

Also, mechanical stress can dramatically affect reliability and precipitate failures unless the PCB and its enclosure is specifically design to withstand those vibration and shock levels:


Solder joints may break up due to tension/compression forces.
Solder joints may not break up but can apply tension force to some components and break them up (ceramic chip capacitor are a classic).
Glued components may loose (if glue is too stiff).
Electromechanical components may latch-up (permanent damage), especially relays.
PCBs may break up, either externally or internally and traces may get damaged.
etc.


All these issues are usually addressed at design level, having the environmental specifications in mind. The specifications drive all the following:


The selection of components and materials (reliable under vibration, no microphonics).
The electrical design of the circuit (tolerance to upsets).
The mechanical design of the PCB (higher clearance to PCB edges, etc.).
The footprints in the PCB (bigger footprints for better solder joints wetting, etc.).
The soldering process (reliable joints with good wetting, no cold joint, etc.).
The mechanical interface between the circuit and its enclosure. (stiffening mechanical parts may be required to avoid resonant vibration modes). 
The mechanical design of the enclosure (to avoid vibration amplification).
The mechanical interface between the enclosure and the place where it has to be mounted (to avoid vibration amplification and to damp vibrations and shock as much as possible).


As you can imagine, if you don't address all these things from the beginning, then you can only pray for it to work under vibration/shock and/or try to mitigate it by replacing some parts (ceramics) and trying to reduce the mechanical energy your board is getting.