Hiring someone younger isn’t illegal by itself. What matters is what the company can prove—and how leaders handle internal candidates afterward.