Optimization of Mayer Problem with Sturm–Liouville-Type Differential Inclusions