How many are you getting at a time? Are they cloudy at all when you buy them, or more or less transparent?
You might try buying a bunch (20 or so, assuming they're cheap) and hope for 5 or 6 to survive. Get the dead shrimp out as soon as you see them during this period, though once you've got a stable population it's perfectly fine to let the shrimp eat the corpses.
As the others have said, they're quite sturdy shrimp once you get past the initial dieoff. Unfortunately your source may have been keeping them in particularly bad conditions such that they really don't stand a chance. You can expect them to die over the course of a couple of weeks to a month at the outside, but the shrimp that survive that period should last years.
To be clear, are the ghost shrimp and endler fry the only inhabitants of the tank? Have you been feeding the filter during the times when it had no inhabitants? If not, the tank likely isn't cycled. The bacteria responsible for the nitrogen cycle in an aquarium need a constant supply of fresh ammonia to survive, so if there have been longish periods in which the tank was empty (or only contained a few fry) then the filter can lose the bulk of its bacteria. If that's the case, you've been adding shrimp, a few die and begin decomposing, which makes lots of ammonia, which kills more shrimp, which makes more ammonia, etc. You can just add a few flakes of fish food or a few drops of ammonia (assuming the fry are out of there) and it will be enough to keep the filter going while empty.
It is possible that there is a problem with your water supply as well, things like copper are not unheard of, but I'd be more inclined to suspect either filtration or the supplier of the animals.