Relationship between structural phase transitions and elastic anomalies in metallic superlattices