I don't think XBee radios, even the higher power XBee-Pro which has a maximum power output of +18 dBm (North America only), will be able to reliably communicate over a 2 mile link in all conditions.
One of the XBee modules with "long range" capability is the XStream which claims:
Indoor/Urban range up to 1500 feet (900 MHz model) Outdoor
line-of-site range up to 20 miles (with high gain antenna)
Now it is probably safe to assume that actual results in the field will not be substantially better than the claims being made by the manufacturer, and the above ranges are under ideal conditions. Assuming there will be times when your car will be driving in less than ideal conditions, such as an urban area, there will be times when their urban range of 1500 feet may be much closer to what you observe than 2 miles.
When designing a data link between your cars the best way to start is not with the radios themselves but rather with a link budget analysis.
A link budget is the accounting of all of the gains and losses from
the transmitter, through the medium (free space, cable, waveguide,
fiber, etc.) to the receiver in a telecommunication system. It
accounts for the attenuation of the transmitted signal due to
propagation, as well as the antenna gains, feedline and miscellaneous
losses. Randomly varying channel gains such as fading are taken into
account by adding some margin depending on the anticipated severity of
its effects. The amount of margin required can be reduced by the use
of mitigating techniques such as antenna diversity or frequency
A simple link budget equation looks like this:
Received Power (dBm) = Transmitted Power (dBm) + Gains (dB) − Losses (dB)
For a data channel you will also need to determine what is the required capacity ( do you need 10 MBits per second or is 300 BAUD OK?) and an acceptable bit error rate. In other words there will be times when data gets garbled in transmission and you need to deal with this either by re-transmission, redundant transmissions, check digits or some such means.
Here is an Intersil Tutorial on Basic Link Budget Analysis.
Bringing this back to what is expedient, the easiest solution would be to simply use higher power radios, if possible. You do not say if this is a school, for profit company or what. Educational projects often use ham radios, specifically APRS for projects like this.
ADDENDUM: One alternative you might like to investigate is TI's CC1120 development kit;
TI claims "More than 10 km out-of-the-box with development kit (139-dB link budget) and 65-dB adjacent channel rejection"