A trainee is an official employee of the firm that is being trained to the job he/she was originally hired for. Literally an employee in training. Typically a lot firms will have a trainee period (2-3 months) where the person is still being evaluated after which an official decision to hire on a permanent basis is made. It is often used as a insurance measure by companies.
An intern is usually understood as a temporary position. Often unpaid (but definitely not required), Usually an intern is a student in the field who is looking for experience in the field before he/she seeks a job. Interns CAN be hired by a firm after the internship is over, but unlike a trainee program (where the hiring is the end goal) and internship is typically for a specific - short- period of time (say 3 weeks or 4 months. Usually internships are reserved for positions in professional fields - a law student may intern at a law firm over the summer. A science student will intern in a laboratory, etc.
When it comes to the medical profession, an intern in the medical field is actually a technical definition. It is a doctor who has completed medical school and has received their degree, but is still unlicensed and not allowed to practice medicine on their own. These are paid positions in hospitals that is a standard rite of passage for medical students. However, it is subtly different from internships as described as a above.