Neither of those antennas have "gain". Gain is compared to a 1/2 wave, that's the standard, so a typical 1/4 wave will always have a negative gain. So, it really amounts to what the manufacturer is making that comparison to. A beer can is one possibility that sometimes 'fits'.
As to those two antennas, the longer one will naturally have more 'gain' than the shorter one. What it amounts to is convenience. If the shorty will do what you want it to do, then it's good enough. If I have to make a 'blind' choice, I'd use the longer one.
And before you make a purchase, here's something to try.
Make a 'tail' to connect to the 'ground' side of the present antenna. Something like a 19" piece of wire will work. You might be surprized at the difference using that 'tail' as the counterpoise instead of the radio chassis will make. Best solution? Nope, but it's certainly less expensive...
- 'Doc