The two batteries' terminals can have completely different voltages, measured with reference to some third object. For example, you could charge up one 9V battery's metal case with a Van de Graff (static electricity) generator so that its negative terminal was at 1000V with respect to the Earth. The battery's chemical potential will then cause its positive terminal to always be 9V greater than its negative. The positive terminal will therefore be at 1009V, with respect to the Earth.
The issue arises with voltmeters, which, as has been said, are not perfect, and do not have infinite impedance. As soon as you connect the voltmeter to the two batteries, a very small current will flow, equalizing the charge on the batteries until the meter reads zero. This happens in the blink of an eye for any normal voltages, and appears to not happen at all.
The issue of voltage being only a relative quantity is extremely important, but entirely separate from this mechanism.
- Warren