Supercapacitors for transient power-out for RPi
Batteries vs Capacitors for capacity vs lifetime cost.
There are many variables. But In general terms, yours are infrequent demand for UPS not daily or hourly, I assume.
Capacitors vs Rechargeable

Ic=CdV/dt or Icdt/dV=C
for Li Ion with 2.4Ah capacity 2.4Ah*3600 s/h= 8640 A-s
3.8V Li Ion with dV=0.8V ,
C = 8640A-s / 0.8V almost 10k Farads! But limited charge cycles 350 but OK for UPS mode as req’d.

vs.

Ultracap 0.5A drain for 2sec with dV= 0.8V C=Icdt/dV=0.52/0.8V=1.25 Farads but &gt;100k charge cycles but shorts out supply to charge up again due low ESR (mOhm) and depending on supply may cutoff or overheat or be ok(?)

Conclusion
Li Ion or Li Po may be better suited on float charge 3.6V than an Ultracap.
Verify : what are your assumptions?
If you reply on 5V input, then your best bet may be a 5V Li-Ion bank for &gt;&gt;10 s of reliable backup and keep it on float charge with current limit.