I see several problems here. The cars could make contact at a wide variety of different places on both cars - for example left front corner contacts right rear corner. How can you sense contacts in a wide range of places? Even if you had (say) 8 contact sensors mounted around each car how could you tell whether the sensor was triggered by the other car or by a wall?
You might be able to use an accelerometer module to detect impacts but it could not tell the difference between contact with the other car or contact with a wall. And it may have difficulty distinguishing gentle contacts from the normal disturbances caused by acceleration, braking and steering.
Maybe you could put a pair of metal bands around both cars arranged so that the bands on one car touch the bands on the other car when the cars come into contact. On one car both bands would be connected to GND. On the other car one band would be GND and the other connected to an I/O pin set as INPUT_PULLUP. When they touch the car with the I/O pin would register the contact. (Heath-Robinson and Rube Goldberg live on )
Maybe 3 metallic bands on each car.
Car 1, from top to bottom would be input, GND, GND. Car 2 would be GND, input, GND
The bottom band would make a common ground, then each car could get the input to detect the collision.
If only one car needed to detect the collision, then it has two bands, input and GND. The second car just has a single strip wide enough to bridge the other car's bands to make the circuit.