Were they sent back to Japan, executed, tried for war crimes, or what? Were they traded for Chinese POWs?
This is an interesting question because of the variety of responses which met Hirohito's announcement of Japan's surrender. One has to keep in mind that the Japanese had several million soldiers deployed in China, not counting all the additional forces stationed in Southeast Asia, Korea, Japan itself, etc.
In short, it is as you might expect when a country surrenders in war. Although there are indeed incidents of soldiers continuing to fight/resist surrender [due to reasons such as a simple lack of knowledge regarding the surrender, or outright refusal to comply], for the most part, Japanese forces were taken as POWs. China supported the unconditional surrender of Japan and its military forces, as put forth by the United States and United Kingdom. Japanese POWs held by the USA and UK were repatriated by 1947, although some POWs held by China were not repatriated until years later.
I do not have any citations or examples readily available for use at the moment, so I cannot address executions, and the other specific aspects of your question. However, I would not doubt if there are incidents of revenge executions.
War crime trials indeed occurred. Commonly known as the Tokyo Trials, numerous flag-grade and general officers were sentenced to life imprisonment, with several others being hung for their crimes. This was the largest profile trial for war crimes. In addition, thousands of other individuals were tried for lower-grade war crimes, of whom sentences ranging from death to acquittal can be found.