What makes Sophie Mol the foil to Estha and Rahel (and, as a girl, particularly to Rahel) is the way the twins constantly use her as a basis of comparison to determine their own worth. In the scene after Estha is molested, for example, he wonders whether Captain von Trapp, the father in The Sound of Music, could love him and Rahel, and thinks he would probably prefer Sophie. Likewise, Rahel thinks the adults see her as a "Littledemon" and Sophie as a "Littleangel." You kind of have to feel for Sophie – there's no chance the twins are ever going to like or accept her. She can't help coming across as the kind of loved and adored child they both want to be.
Ammu and Margaret Kochamma have had surprisingly similar experiences. Both originally left home to have a bit of adventure and assert their independence from their parents. Both ended up in unsuccessful first marriages as a result of said adventure. Both are now single moms raising young kids. And both find Chacko exasperating.
There is one significant difference, however, that makes Margaret the foil to Ammu: she is British, and Ammu is Indian. As a result, when Margaret and Sophie Mol arrive at the airport, Ammu is determined to put her best foot forward, to prove to all the Anglophiles in her family that she is just as good as Margaret, and has raised her kids just as well. Ammu's rivalry with Margaret forces her to reflect upon herself and the life she leads.