First thing you must do is determine if you had on the basis of training, lenth of service, diciplinary record etc, a reasonable expectation of advancement into that position.

If you have then decine to do on the basis that it is not a reasonable request or instruction. If you are good enough to train him then you are good enough for the position.

Under the circumstances a reasonable person would conclude that your boss is not acting in good faith towards you. It is simple prudence to assume that your boss intends to dismiss you once you have this chap trained.

If you are given a direct instruction to train him, require your boss to put that instruction in writing. Make it clear that you will only comply with a written instruction and that you will consider that instruction to be tantamount to a direct threat of dismissal without pay or references.

I cannot determine from your post whether your boss is your immediate superior or your employer. If he is simply your immediate boss then make a formal complaint via your company's procedure. If he is your employer then make it clear, in writing, that you are unhappy with the situation and ask for a formal written explanation.

I would strongly suggest that you obtain formal advice from someone trained in employment law.

And go work for the opposition.
_________________________
I don't do dumb & helpless.