If your DCC system permits decoder programming on the main
track, you should be able to speed match without affecting 'non involved' locos
also sitting on the track. Generally speaking, however, it is much
safer to do all CV work on a 'program track' or to isolate non involved
locos on a 'dead' spur. It is always possible
to push the 'wrong button' and make unintended changes to
the 'wrong' loco decoder.
'Programming on the main' will not affect the others as long as it's simple, like changing whistle type, or volume, maybe even chuff rate on steam... In fact I believe P on the M prevents serious programming anyway.. IF you are in POTM and you can do it, just do it, since you're connected with that loco's address, only. Locos in consist would be a different story....
[ disclaimer: I'm not a real doctor. I just play one on TV ]
As Don says, if you can use your system to "program on the main" or whatever your system calls it, then you can definitely speed match locos by tweaking the CV's of the locos in question. It will send programming commands only to the locos designated.
BUT, as he said, it's very easy to get careless or make a mistake and reprogram EVERY loco. If that's not a result you can live with, then I would isolate or remove your other locos first.