simple battery back-up power path design idea
Everything looks good except for the BSS138, which would be better replaced with a Schottky diode. 

The diode will have a voltage drop of 0.3~04V when the power is on, but the BSS138 would have much higher loss since it needs about 2.5V on the Gate to turn on (its body diode is also facing the wrong direction, but that could be fixed by simply swapping the Source and Drain). 

Using a transistor here is unnecessary because Vin must be higher than the battery's peak voltage anyway (in order to charge it up fully) so the small drop through a diode should not be a problem. 

If you are worried about excessive voltage sag as the power goes down then you could also put a Schottky diode across the IRLML6402. The FET will turn on and connect the battery directly to the load once Vin drops more than 2V below the battery voltage, but before that its body diode could drop 0.6V or more.