Joe Root scored his 39th Test century, moving above Sri Lanka great Kumar Sangakkara for the number of hundreds in the longest format.