Crowdy et al. (2023 Phys. Rev. Fluids, vol. 8, 094201), recently showed that liquid suspended in the Cassie state over an asymmetrically spaced periodic array of alternating cold and hot ridges such that the menisci spanning the ridges are of unequal length will be pumped in the direction of the thermocapillary stress along the longer menisci. Their solution, applicable in the Stokes flow limit for a vanishingly small thermal Péclet number, provides the steady-state temperature and velocity fields in a semi-infinite domain above the superhydrophobic surface, including the uniform far-field velocity, i.e. pumping speed, the key engineering parameter. Here, a related problem in a finite domain is considered where, opposing the superhydrophobic surface, a flow of liquid through a microchannel is bounded by a horizontally mobile smooth wall of finite mass subjected to an external load. A key assumption underlying the analysis is that, on a unit area basis, the mass of the liquid is small compared with that of the wall. Thus, as shown, rather than the heat equation and the transient Stokes equations governing the temperature and flow fields, respectively, they are quasi-steady and, as a result, governed by the Laplace and Stokes equations, respectively. Under the further assumption that the ridge period is small compared with the height of the microchannel, these equations are resolved using matched asymptotic expansions which yield solutions with exponentially small asymptotic errors. Consequently, the transient problem of determining the velocity of the smooth wall is reduced to an ordinary differential equation. This approach is used to provide a theoretical demonstration of the conversion of thermal energy to mechanical work via the thermocapillary stresses along the menisci.