When the relays are switching OFF the voltage jumps up between those terminals for a moment. This voltage can be quite high positive value at the collector, so a diode is added in parallel with the relay to handle the spike voltage and protect the more sensitive switching transistor.