if u talk about remedy(compensation) it's civil cases but not criminal cases
then, in civil cases, it all depends on a question - Who caused the damage?
In your case, it can be A solely responsible for the damage because A may be driving too fast and hit B(which is stationary or driving very slowly) and push both cars into a garage
OR B is also speeding and will run into the garage anyway, A just hit it b4 B run into it.. then B had contributed to the damage too
SO we don't have sufficient information to determine the case