I don't think Ainus and Tocharians are related. I am sure they mixed though. Ainu and Tocharian language are very different. Ainu is a language isolate like Basque. I have read Ainu could be related Austranesian (Polynesian languages like Tagalog, Malay, and Javanese) or Austrasiatic (eg. Vietnamese, Khmer, Munda, etc) language family. Another theory is Ainu could be related to Burushaski and Basque.