Ergodic control of infinite-dimensional stochastic differential equations with degenerate noise