Spanish train driver transferred to police custody