we know that
P = V2/R
or
P ~ 1/R
thus, the bulb with a smaller power will have higher resistance and vice versa.
So, 40W bulb has a higher electrical resistance than 60W bulb. Regards