ssh remote-host ‘cd proj-dir; python remote-worker.py’;
python train.py

I am not sure this will work in your environment. You still need to make sure different hosts are connected, so you probably need to use sth like SLURM to deploy multi-node training.