I too had a similar battery problem but on the Nexus 6P, the solution for me was to go to developer options and under networking turn off Mobile data always active. Then use up your battery completely, after the phone turns off try to turn it on till it boots up, it took me 3 times till it turned on, and keep using it until it turns off by itself, my phone just stayed at 2% for 2 hours of use. After the phone turns off by itself a second time charge it up and see if battery life has improved.