General rule of thumb with nature, try everything once. If it fits in an animals mouth, gains some nutritional value from it, doesn't taste awful or poisons it or the energy used doesn't out weigh the energy spent catching it then it becomes dinner. Problem is reproduction takes time feeding doesn't, as fast as shrimp like to breed you would struggle to get something breeding faster than something feeding. With a tank full of small fish the young shrimp only need to survive get to a size where a small fish can't tackle it, some will and some won't. As you add bigger fish the survival rate keeps on diminishing until you hit a point where there are fewer survivors and less breeding and the shrimps chances of survival go down and down and the ones that are big enough to survive the fish drops through natural deaths until the colony collapses.
For best chance the colony needs to be massive to start with and the fish added later. Adding shrimp to a tank of fish immediately tells them food because usually when the fish see you adding something to the tank it is food, for them to see something bright coloured added by you to the tank they immediately make the food connection especially when it's moving. That's why breeders use live food to get young fry eating. The fact it's moving and fits in its mouth is a trigger to chase it down.
You could keep the fish well fed as well. Fish not being hungry makes it less worth while chasing a shrimp down. Rams and Tetras though are quite active feeders, after a good feed you could go back an hour later and they will take food again. Maybe because they come from warmer water and their metabolism runs quicker so they eat little and often, not sure.
Having said all that some fish seem to acquire the taste, probably because they tried once and it paid off then there's no turning back. I've had Betta that would spend all of the day hunting down shrimp but then again I've seen people with shrimp and Betta together and the Betta are totally uninterested. They just check them out then leave them be.