There are 13.7 Volt plug packs available, specifically for float charging lead acid batteries.
You can simply connect that in parallel with the 12V 7Ah battery and then to the router.
When the AC power is on, the plug pack charges the battery and powers the router. When AC power is off the battery powers the router.
Don't worry about the extra 1.7 Volts, routers use DC to DC converters and can handle a wide range of input voltages.