How to cook small fish(unfrozen and frozen) in water without overcooking?
As with all fish, just don't cook it any longer than necessary - all you need is long enough to get the temperature up (to 145F/63C), and anything past that is just overcooking. Boiling is a really fast cooking method, and simmering or poaching is not much slower. Note that this also means removing it from the water as soon as it's done, since the water is way above the necessary temperature and will easily overcook seafood even if it's removed from the stove.

Tiny fish like you mention will probably be done in only a minute or two, similar to small. The best way to tell, though, is not to use a timer but to directly check the fish: it should be opaque and flaky. (For small fish, those aren't very big flakes, but you could still pull it apart or bend it and tell.)