This is why the people responsible (i.e. commanding officers, if the war crime was under orders) are tried, and the people committing them have to deal with processing it.
Several thousand Japanese soldiers, the vast majority of which were not command staff, were tried for war crimes. About 1000 were sentenced to hang, and many more were sentenced to life in prison or long prison terms.