Phytolacca octandra is the species commonly naturalised in the mid-temperate parts of Australia, though I have seen plenty of P. americana on the subtropical east coast (not generally as far south as Sydney). The sessile, very crowded fruits suggest P. octandra.