The BQ25690 plus the current limit switch might work here. In forward mode, the BQ25690 charges the battery from power at VBUS. When VBUS drops below a certain threshold, the BQ25690 backup mode feature can be armed to automatically operate in reverse…