I did see one programme on t.v where a u-boat was off south america with some Japanese personnel on board being taken back to japan with plans etc on board when Donitz gave the order to surrender. The german crew either wanted to sail into a south american port and be interned or to scuttle the vessel off shore and swim in and disappear among the local population, probably Brazil then. The japanese still being at war didn't want to do this and committed suicide or if there was a reluctance to do this i think the crew assisted them a bit. I also believe that there was radio active material on board which the germans having surrendered to the south americans became of great interest to their neighbours further north. I also understand that some of this material was then used in the manhatten project providing the means to ensure japans defeat. If the japanese had had this material even if they couldn't have made a bomb they could/would have used it to contaminate any landing force in the event of mainland japan being invaded, the war might have ended in a no score draw.
Both Germany and Japan had the means.