(A) has intramolecular H-bonding and (B) has intermolecular H-bonding
Intramolecular hydrogen bonding in o-hydroxybenzaldehyde (A) results in a less rigid structure compared to p-hydroxybenzaldehyde (B), where intermolecular hydrogen bonding leads to a higher degree of molecular association and therefore a higher melting point.