The two cars are under an uniform linear motion. So, the distance traveled by them is given by:
is the same for both cars when the second one catches up with the first. If we take as reference point the initial position of the second car, we have:
The surface of the table and brick may not match up perfectly. This means that friction may occur leading to the brick slowing down or some bit of heat resulting from the contact.