How can an insertion loss provide gain
You can match a 50 ohm source to a 25 ohm load using a resistive pi network however this will naturally attenuate the signal by no less than about 7.67 dB (see this calculator here and try it out your self).

So for a 50 ohm input and a 25 ohm output the resistors are: -




Shunt in = 30.015 kohms
Series  = 35.44 ohms
Shunt out = 35.36 ohms
Attenuation = 7.67 dB


Or you could match using a pi network of reactive components and this will give less attenuation but makes it frequency dependent.

Or you can use a step down impedance matching transformer. This will have a step down ratio that is the square root of the impedance ratio i.e. 1.4142 for a 50 ohm source and 25 ohm load. This will give zero dB loss and so, with respect to matching with a resistive pi network, it represents an insertion loss of -7.67 dB or a gain of 7.67 dB.