In the light of the job being a contract, I don't see the issue.
There are many reasons why companies use agency/contract staff, but it's usually an expensive way of getting a job done long-term. So, it'll usually either be a short-term requirement, or a stop-gap measure while long-term needs are sorted out. Sometimes, it's just a stop-gap while permanent recruitment is done.
In either case, I don't see how a contractor has either grounds to complain or a need to feel insulted. I don't see how it's any personal reflection. The company just now needs a permanent staffer, and found someone that, for whatever reason, suits the role better.
That's the whole point of contract - no commitment. And it usually suits contractors, too. If it doesn't, stop contracting.
Phate, I can see you're upset, but from an impartial distance, I can't see why. If it really gets to you, don't do it. You are, after all, contract, so don't have to do things you don't wish to. But, if you drop the company in it by being awkward, I'd guess you can kiss goodbye to any goodwill, and with it, a reference. Is it worth it?
I can't see it as insulting, or indeed, any personal reflection on you at all. In my view, do the training and move on to the next contract.