Transition-path probability depends non-monotonically on memory time for non-Markovian systems