Thermodynamics of (001) epitaxial ferroelectric films completely relaxed due to the formation of elastic domains with a three-domain architecture is presented. The polydomain structure and electromechanical response of such films are analyzed for two cases corresponding to immobile and mobile elastic domain walls. It is shown that immobile elastic domains provide additional constraint which increases the mechanical and electrical clamping, thereby significantly reducing the piezoelectric and dielectric responses. On the other hand, a polydomain ferroelectric film adapts to the variations in the applied electric field by reversible domain wall displacements in the case of mobile domain walls. The comparison of the theory with experiments shows that the elastic domain walls are mobile in the fully relaxed films of ~ 1 m thickness. In addition, if the substrate constraint is reduced via decreasing lateral size of a polydomain ferroelectric film, its piezoresponse will increase dramatically, as is experimentally verified on small islands of polydomain ferroelectric films. The general conclusions can be readily applied to other constrained polydomain films.