Thermal effective Lagrangian of generalized electrodynamics in static gravitational fields