While the costs of works in a dense city may be more expensive they will serve a vastly denser population so the cost in theory is split between many more people and is thus lower per capita. We see the same in providing essential services, things are just more expensive per capita in less densely populated and more rural areas.
Typically the very dense are as I said more expensive per head than medium density towns etc
London will probably actually work out similar to pretty low density when you take into account historical costs. (IE some sites will sit on land worth a fortune at current value)
Its difficult since two projects in dense populations can look very very different, mainly down to if land exists already.
Eg the price of creating a substation where land needs to be procured in a densely populated city is a world apart from one where a site already exists and all your talking about its the direct infrastructure costs itself.
HS2 is a prime example of this in regards how much was spent securing the land needed, vs say had we have been able to rip up one of the existing rail lines and installed the HS2 there.
I expect like in many things there will be areas of high density populations where there is space to upgrade to support high electricity usage and other areas where there simple isn't and they will need to either procure space or look at other options (like larger substations further out)
Really these sorts of thing tend to have a cost per head much like an inverted bell curve with both the extremes being expensive per head and the middle ground where the land is relatively cheap and the economies of scale already reached being the low cost per head.
It should be recognised that all the DNOs have a variety of high and low density its just that some lean more to one extreme than the other.
Things like meters, the meter costs the same, but the cost of a meter installer will be more in London than the midlands.