From my experience, I would say yes, a tinfoil barb would definitely be able to coexist with a red-eared slider in 500 gallon... assuming that size difference was not an issue. For example if you have a puny tinfoil barb and a fully grown slider, then eventually the barb is bound to be devoured. But if you have a medium-sized turtle and a large tinfoil barb, that would work very well. My basic rule is to make sure the fish is larger than the carapace of the turtle's shell, but the turtle is far too large to be swallowed by the fish. I had a largemouth bass eat one a baby painted turtle my brother caught.
However, a convict would probably do worse with the slider. A fish that swims away from a turtle is better than a fish who will stand and fight the turtle and inevitably lose. A baby slider could probably live with a convict but convicts don't usually get big enough to be housed with turtles long-term.