Pass by quietly without reacting (ignore them).
Dogs may become more excited or remain on alert and keep barking in response to "loud voices" or "sudden movements." The safest and most effective approach is to pass by without saying anything or making eye contact.
Keep a bit of distance.
Even if the other dog is small, if a young child is holding the leash, they may not be able to control it. It's reassuring to physically distance yourself, such as walking on a slightly separate part of the sidewalk.
Mutter quietly, "That really startled me," and leave.
If you end up making a sound, it's best to murmur something like "That startled me" in a low tone, expressing surprise rather than anger, and then quickly walk away. That's my personal take.