Japan’s imports and exports set records in July and soaring energy costs and a weak yen helped extend a trade deficit for a third month, government data showed.…