First, repeatedly over time spray the upper bolt heads with a GOOD penetrant like PB-Blaster, Break-Free, or (in last place) Liquid Wrench. Let it work for a while, it takes some time to get into the threads. No, WD-40 will not work for this.
Then you just need a long length of multiple ratchet wrench extensions to be able to reach up to those bolts. I forget how many I need to get up there but I probably have 2' of extensions between the socket and the ratchet wrench to reach the bolts.
But they can snap off if they're corroded (especially if they salt the streets where you live) so make sure to let the PB-Blaster, Break-Free, or Liquid Wrench work on them first. Several days of letting it soak in with repeated sprays is actually highly recommended before you try to get them out. Otherwise, you could be faced with a snapped bolt which then turns the job into a nightmare.