Maximal subsolutions for a class of degenerate Hamilton-Jacobi equations