SAN SALVADOR — On a cloudy afternoon, Mayra Ayala shepherded her family along the winding footpaths of a hillside cemetery in Ilobasco, a town about 35 miles from the capital. The group of nine clambered over dozens of brightly painted mausoleums while descending to a purple tomb topped with three crosses.

Two years had passed since Ms. Ayala’s husband, José, and two of her sons — Vladimir, 21, and Douglas, 19 — were murdered by members of the street gang MS-13. Mr. Ayala, a community leader in one of the gang’s strongholds, had routinely spoken with Ilobasco’s mayor and police officials, who were trained by American advisers to build rapport with residents.

But to MS-13 leaders, those conversations signaled that Mr. Ayala was an informant — an allegation his family denied. One morning in March 2016, they ambushed Mr. Ayala and his sons at the family’s tile workshop.

Ms. Ayala, 45, and most of her children are now in hiding, moving between homes in their old neighborhood. They are supported by her son Alexander, who survived the slaughter and is seeking asylum in the United States. She is ambivalent about America’s involvement in her country: One of its initiatives to combat gang violence destroyed her family, yet in many ways it has made the neighborhood safer.