They are quite similar. It depends quite a bit on the sport, and the degree of skill in that sport.
In terms of a difference, a trainer is more concerned with fitness, and physical performance, whereas a coach is more concerned with skills and tactics. So, for football, you would probably have a coach, and for say running, you might have a trainer.
Some high-level professional football teams will have both, with them performing different roles as I mentioned.