Josh Inglis hit a century in Australia's chase before Nathan Ellis led the side to victory.