Since two bulbs are in series they will get equal amount of electrical current but as the supply voltage is constant across the bulb(P=V^2/R).So the resistance of 40W bulb is greater and voltage across 40W is more (V=IR) so 40W bulb will glow brighter.