The Servo library disables PWM on pins 9 and 10.
Read the documentation. Servo library.
`
On boards other than the Mega, use of the library disables
analogWrite()(PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins.
Good job on your first post. You provided relevant information and posted the code properly. Most new users don't bother reading the guidelines. Thanks.