Broadly speaking, a coach is someone who is in charge of the entire team's preparation, while a trainer's job is to focus on individual athletes' conditioning.
Linguistically ... uh ... etymologically ... the two words come from two different sources, even though they mean, roughly, the same thing.
Train, a verb meaning instruct, discipline, or teach was first recorded in the 16th Century. It comes from the Old French train, which means "to pull, draw," which, in turn, comes from from the Vulgar Latin traginare.
Coach comes from the Hungarian kocsi szekér, a wagon of Kocs, village in Hungary where coaches were first made. The habit of calling a teacher coach may have come from the idea that the instructor carries his pupils. The origin of the term is traced to 19th Century Oxford slang.