A trainee is a general term for anyone who's in the process learning their job. We use it to distinguish between the fully trained employees and those who are not yet fully trained. Trainees usually have less responsibility and are paid less. We can use this term for a range of different jobs and industries.
The term 'apprentice' is much more specific. It goes back to the days when a young person, usually a teenage boy, was in the care of a master craftsman for a number of years while the man taught the boy his trade. This was how the skills of being a carpenter, blacksmith, tailor and so on were passed on to the next generation. It's sometimes used for manual trades, such as e.g. 'apprentice mechanic', particularly if they are training 'on the job', but it isn't a common term these days.