Wales had earlier caused an upset by beating Argentina in the quarter-finals with a gutsy 14-7 victory.
Australia, chasing one of the automatic spots for the Olympics, were looking defeat in the face with Wales leading 12-5 in the second half but Cameron Clark darted over in the corner in the last minute of action to give Australia a 17-12 victory.
It was a heart-breaking defeat for Wales after a heroic defensive effort kept them in the game.
Both teams probed each other for the opening three minutes before Cameron Clark finally broke the deadlock.
Wales’ persistence was rewarded after the hooter when Adam Warren slid over on the greasy surface to level the score at halftime.
Wales edged in front after the break after Luke Morgan offloaded to the supporting Craig Price who dived over wide out. An excellent conversion from Tomos Williams put Wales 12-5 ahead with three minutes to cling on.
Australia hit back through Tom Lucas who converted his own score and with their tails up, Australia clinched victory when Clark ended Welsh hopes, plunging over in the last minute to send Wales home empty handed.
Wales began the day in brighter fashion, beating Argentina 14-7 in the first game of the day in Tokyo.
The Pumas controlled the ball in the opening stages of the game on a heavy surface to work Rodrigo Etchart over for a converted try but some Welsh magic by Rhodri Williams soon levelled the score.
Wales were going nowhere under tight defence, but the Scarlets scrum half took matters into his own hands, sidestepped his way through the Pumas to score under the posts to give Tomos Williams an easy conversion.
Tremendous defence by Tomos Williams denied Etchart from scoring his second half and moments later the Wales Under 20 scrum half hacked upfield after winger Luke Morgan presented the ball for Williams to put Wales in 14-7 in front with two minutes left – a lead which they weren’t to surrender.
Wales picked up only five points for their efforts to slip to 12th place in the overall rankings with just two rounds left to play in Scotland and England.