A probabilistic analogue of the mean value theorem and its applications to reliability theory