Use battery supply as backup
If you set or design the step-down regulator to 5.6 V but the step-up converter (after the battery) slightly lower, for example to 5.3 V then as long as the 12 V power is "up" the step-down regulator will always "win" (be used, supply the current) as it delivers a slightly higher voltage.

When the 12 V power is off, then the step-down regulator cannot supply a voltage so the step-down regulator will will be used.

I recommend adding a battery protection circuit between the battery and the rest of the circuit so that when the 12 V power is off for a long time, the step-up converter cannot fully deplete the battery. It should stop at about Vbat = 3.0 V to prevent over discharging of the battery which damages the battery.

A battery protection circuit will simply disconnect the battery when Vbat gets too low (and too high as well if the charger circuit breaks).

But allow me to suggest an alternative solution: many power banks come with an input and an output socket and allow for supplying 5 V and charging the battery at the same time. Then you would have a complete finished, working solution. If the powerbank needs 5 V in put then you only need a step-down regulator module.