Optimal control of differential inclusions with endpoint and state constraints and duality