A priest who was caught sexually assaulting a sleeping man on a train has been jailed for 16 months.