Fundamental circuits - diodes
Not very clear to me what this circuit is doing without part values, but Q2 might be used as a temperature offset compensation for Q1 if they are the same device.
The other effect is that it also acts as a low leakage diode.