All indications are that they escaped successfully and that Sloan actually died
[Bashir stands up, clears the cobwebs, then looks over to a shaky O'Brien, sitting up from his bio-bed. Bashir then gazes at Sloan's body, lying motionless on the bio-bed.]
SISKO: He died about two minutes ago... Almost took you with him.
[Bashir glances back at O'Brien.]
Extreme Measures - Original Screenplay
It seems extremely likely that Bashir would have conducted a full autopsy on the body (which would largely rule out any transporter bait & switch jiggery pokery) and given that that Sloan was incapable of creating a realistic artificial environment for Bashir and O'Brien means that it would be trivially simple for them to check whether they were still inside his mind by simply picking up an unread book or medical journal and turning to page one.
The actor who portrayed Sloan, William Sadler was also given to understand that he did indeed die.
You appeared in three episodes, but were there plans to see more of Sloan? Did (writer-producer) Ira Steven Behr ever tell you?
Sadler: I think it was always planned that Sloan would die in the third one. I think they planned it as an in and out thing for this
character, though there was a lot of space between the episodes. And
my last one was a couple of episodes before the series ended. But no
one ever said anything, that they were thinking of me for three or
less or more.
StarTrek.com - Luther Sloan from Deep Space Nine - William Sadler
Sloan's official record on StarTrek.com indicates that he's dead.
Amoral agent in a secretive division of Starfleet Intelligence called Section 31 who repeatedly tried to recruit Dr. Julian Bashir into the covert agency. In 2375 Sloan committed suicide rather than give up the cure for the Founders Disease, but Bashir and Miles O'Brien recovered the information anyway.
StarTrek.com Database - Sloan
The timeline in the EU novel Star Trek: Avatar indicates that he's dead.
Bashir extracts the cure to the Founder disease from the mind of Section 31 operative Luther Sloan. Sloan commits suicide, but Bashir succeeds in curing Odo.
Star Trek: Deep Space Nine - Avatar
Sloan's article in the (canon) Star Trek Encyclopedia is also similarly blunt.
"Sloan committed suicide in late 2375..."
Star Trek Encyclopedia - 3rd Edition - Supplement p683