Are you sure it's the backup time that is bad and it's not the power saving feature of the UPS?
Some cheap UPS are not designed to work for low load scenarios such as routers or small SBCs.
If they don't detect a load of over a certain power draw then they turn off.
Did you try turning the UPS on after it turns itself off and check?