Она улетела, It flew off /correct/
а but is closer than and by meaning
тоска there's no such exact word in English, it's more like anguish, not gloom.
осталась необъяснённой, kept/left/remained unexplained (passive)
ибо because
... мысль a ... thought
не могла её объяснить could not explain it.

The 'proper' translation seems to be:
'It flew off, and the anguish remained unexplained, for it could not well be explained by another brief thought that flashed like lightning and at once went out;-'

But for this to be correct, I think объяснить would need to mean 'to be explained by' not 'to explain.'
I don't understand what you're takling about

My try (just rewording plainly closer to the original sentence meaning -- slightly changed clause order)
It flew off, but the anguish remained unexplained, because a brief thought ... , flashing like lightning and then dying away, could not explain this anguish.