Being what certain parties in their invective call a sceptic, I have reservations on global warming, and even more reservations on its significance, but I regard other issues as far more important, such as the conservative and efficient use of resources, including power. So I shall answer from that perspective, in terms of power efficiency rather than CO2 efficiency.
A good modern kettle, such as an immesion element in a plastic container is in isolation one of the most efficient means of domestic water heating. There are many ifs and buts; for small amounts of water in some containers a microwave oven can be better, but generally I think the kettle has everything beat, except for a high quality geyser, and even there the kettle wins because it heats only the water immediately needed, whereas the geyser constantly loses heat.
It should be possible to improve the efficiency of a gas hob by using baffles to slow the escape of the hot gases from round the kettle, but I have not seen many attempts to do anything of the kind. Does anyone know why this is, apart from indifference to waste? Anyway, I don't know how much improvement would be possible along those lines. I doubt that the run-of-the-mill kettle on a hob is anywhere near 50% efficient, and yet in general gas is comparatively efficient as combustion goes.
It would be hands-down for the kettle, except that the electricity that it uses is subject to losses in generation and in transmission. These are not constants; some old power stations are very inefficient thermally, some new ones are pretty good; some transmission lines are excellent, some are not nearly so good. From the greenhouse gas point of view some are fairly reasonable, some are rotten. Nukes and renewables are excellent, or should be, depencing on who is putting the spin on the efficiency of their construction. (This is a game of spin. If we could run the planet on spin...!)
Now, using up-to-date generation and and delivery of both gas and electricity and up-to-date equipment and practice in the home (no forgetting the kettle boiling on the hob etc) then I would say the kettle would win hands down. I cannot however answer for all the variables one gets in various parts of various countries and various homes. By and large, the greater the inefficiencies in general, the worse the gas inefficiencies become, what with lousy equipment and leakage. It is just that the scope for inefficiency in all modes of power usage is so large that there always is room for spin and downright dishonesty.
And none of that even deals with the question of what a kWH costs the user; often, rightly or wrongly, the state and scale of the infrastructure determines that the least efficient option is the easiest on the pocket of Ma Jones brewing up her cuppa.
Me? I favour the kettle in by far the most ways, but please don't ask me to prove it. All I will guarantee is that whichever answer you offer, someone will come up with lies, evidence, arguments or myths to prove that you don't know what you are talking about and that you must be in the pay of the enemies of peer-reviewed papers and the oil companies.
In short, your question concerns a slippery subject in which pinning down the factors that really matter is very, very tricky, a joy to the spin doctors.