How can one of the RC networks of this active high pass filter topology work as an actual high pass filter?
I do not understand how the one composed by C2 and Rg can actually
  work as a high pass filter, since the capacitor is connected to ground
  - shouldn't it work as a low pass filter instead, as high frequencies would go through it?


The gain of that op-amp stage at high frequencies is: -

$$1+\dfrac{R_f}{R_g}$$



And at DC, the gain is unity because capacitor C2 has infinite impedance: -

$$1+\dfrac{R_f}{\infty} = 1$$

So, the op-amp stage can act like a high-pass filter in that it can amplify AC signals to a greater degree than DC signals.