Japan posted a trade deficit in October for the sixth consecutive month, with official data showing that the growth in imports outpaced the continued rise in exports.