Measurement of longitudinal flow decorrelations in Pb+Pb collisions at sNN=2.76 and 5.02 TeV with the ATLAS detector