Japan 's trade surplus grew in June for the first time in 20 months as an export slump eased while factory output rose 2.4 percent from the previous month , after a revised rise of 5.7 percent in May .