You put them up there so you get a voltage boost from the gravity pushing the electricity down. Put the generators on the ground floor, and by the time the electricity reached the top, there would be a voltage drop.
Carrying the diesel fuel up 18 flights of stairs also enhances its potential energy. About 47 Joules per foot.
You get out of it what you put into it. ;)
Factoring in gravity isn't good physics or engineering. Gravity's effect is negligible in a generator placement in a skyscraper