Australia go into Day Three of the Test with a slight upper hand after a seesawing battle highlighted by Joe Root's outstanding century.