The US president has lashed the former prime minister in a late-night social media post, just as Trump is poised to decide whether to exempt Australia from tariffs.