Nonincrease almost everywhere of certain measurable functions with applications to stochastic processes