It is not simple. You usually cannot just change the name. You must cancel the old ticket and buy a new one with the correct name. Best thing is to call the train company directly. They can help you. The new ticket price can be more money, so be ready.