Most of the main planetary satellites of our Solar System are expected to be in synchronous rotation, the departures from the strict synchronicity being a signature of the interior. Librations have been measured for the Moon, Phobos, and some satellites of Saturn. I here revisit the theory of the longitudinal librations in considering that part of the interior is not hydrostatic, i.e. has not been shaped by the rotational and tidal deformations, but is fossil. This consideration affects the rotational behavior. For that, I derive the tensor of inertia of the satellite in splitting these two parts, before proposing an analytical solution that I validate with numerical simulations. I apply this new theory on Mimas and Epimetheus, for which librations have been measured from Cassini data. I show that the large measured libration amplitude of these bodies can be explained by an excess of triaxiality that would not result from the hydrostatic theory. This theory cannot explain the phase shift which has been measured in the diurnal librations of Mimas. This speaks against a solid structure for Mimas, i.e. Mimas could have a global internal ocean.