This would be illegal in Europe. Unless you are redundant (or incompetent/insubordinate) you cannot be laid off. I guess you could be asked to train someone so that there are two people doing the same job. Then one of them could be declared redundant at a later date.
But this would be for a consulting contract that is ending and probably not going to be renewed. -So I guess "laid off" may not be the correct terminology.
I went ahead and trained my replacement to the best of my ability while I looked elsewhere for a position. The company I was working for at the time had been purchased and my job was going to be exported. I preferred not to relocate.
With your contract ending and apparently not being renewed, I assume either you preferred remaining a contract consultant and did not express permanent interest in the position or the company has determined that someone else might be a better "fit". Either way, I would recommend training them as best you can and call it good at that.
If your original contract did not include you to train your replacement, I would not do it. I typically work to my contract's scope, and if trainng is not part of that scope, then I decline politely.
It's no different than if they hired you as a mechanical engineer, and then asked you to do some electrical transformer design (assuming you have the skills). The contract is the governing document. If it's not in the contract, then it is not in the contract. If nothing else, my rates are different for what I do.
"Do not worry about your problems with mathematics, I assure you mine are far greater."
Albert Einstein
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?
If you are being replaced against your will, the professional response is to provide your replacement with the information he needs to do the job. There is no need to give him the knowledge that will actually get the job done (e.g. "this is the phone number for the company supplying parts xyz". but no need to mention that "if you ask for Mr ABC he's always really helpful and will get what you need. Their switchboard is a nightmare and you'll be chasing your tail for weeks trying to get that part without his help"!)
As a new business owner I would like my first clients to provide good references for those that will come after them.
I think that offering training within the context and topics of the deliverables my assignment here is reasonable and I will not withhold any information/knowledge/know-how that was applied towards reaching those results.
Einstein said, "The more I learn, the more I realize I don’t know." -Maybe they'll ask me for more help when they have extra funding...