Necessary and Sufficient Conditions for the Nonincrease of Functions of Solutions to Constrained Differential Inclusions