A generalization of an inequality by N. V. Krylov