The Tor Browser Bundle is a modified version of Firefox. It includes some "hardening", tweaks and patches to make it more secure, but many Firefox zero-day exploits can still be used against it. The best way to avoid these is to disable Javascript globally with the built-in NoScript add-on. There are comparatively very few exploits of HTML parsing and rendering, so it's extremely unlikely that you'd get identified or infected with Javascript disabled. (Anecdotally, however, see canvas fingerprinting for a new and scary exception to this trend.)
As far as I know, though, there isn't any means of transmitting malware through the Tor Browser that doesn't work on standard Firefox.
For a recent and notable example of a Javascript exploit being used to deanonymize users, see this:
http://www.wired.com/2013/09/freedom-hosting-fbi/
http://resources.infosecinstitute.com/fbi-tor-exploit/
Note that, in this case, users' computers weren't infected. The exploit only leaked their real IP addresses, which allowed them to be identified and located. Many "Tor specific" attacks are of this nature, as exposing a user's real IP address is not an exploit at all if that's the IP address they're using publicly.
In regards to the page telling you their "exploit was successful", it's much easier to type:
<html>
<p>exploit was successful</p>
</html>
Than it is to exploit a hardened up-to-date Firefox browser. It's possible you got infected, but you're probably fine.
Remember to keep your Tor Browser up-to-date, disable Javascript, and follow these guidelines. If you do, you're about as safe as you can be in a modern web browser.
And, to answer your last question, yes, Tails is safer. It attempts to route all Internet traffic through Tor, so even some exploits that get by Firefox will still not access the real IP. However, as with all security software, Tails does occasionally have exploits of its own.