New safety features being rolled out by auto makers to keep drivers from hitting pedestrians don’t work at times in some of the most dangerous situations and frequently fail at night, according to a new study by AAA.

Testing performed by the association found that pedestrian-detection technology offered in four different models performed inconsistently and didn’t activate properly after dark, when many roadway deaths occur.

The...