We consider a family of Laplace-Beltrami operators corresponding to a smooth deformation of Riemannian metrics on a compact manifold with or without boundary. We suppose that the initial metric is either completely integrable or close to a non-degenerate completely integrable metric (KAM system). If the deformation is isospectral we prove that the values of the corresponding Mather's $\alpha$-function given by the average action on the KAM tori is constant along the deformation. As an application we obtain infinitesimal rigidity of Liouville billiard tables. The proof is based on a construction of quasi-modes associated with KAM tori.