If a Tallit was thoughtlessly taken into a bathroom - for example to remove a stain - is it defiled, or can it still be used?
Don't worry about it. The practice of not bringing a Tallit into a bathroom is a strong custom (because the Tallit is a garment designated for prayer times, as opposed to the undergarment tallit katan which we do bring into the bathroom), but not technically a law. This is why you can make the blessing on it, then have in mind to remove it, use the restroom, and put it back on without another blessing -- you could theoretically, at the letter-of-the-law level, kept it on the whole time.
Rabbi Yaakov of Lisa -- known as the Nesivos -- writes (Nesivos HaMishpat 234:3) that if one violated a Rabbinic commandment by mistake (and we mean a real mistake), then further repentance is not required -- just make sure not to do it again. That would certainly be the same here, when all we're dealing with is a custom.
A Tallit is simply a four-cornered garment with the right knots and strings on it. You can't invalidate it by bringing it into the bathroom. It still accomplishes the same goal, i.e. fulfilling the Torah's commandment to have fringes on our four-cornered garments.
But please don't bring a Tallit into the bathroom.