Why was Yui happy at the end?
I believe she was happy to be free from her life as a prostitute - When Suitengu enters, she treats him like another client, begging for money and initiating intimacy by sucking on his fingers.

Yui's life was a wreck and you can see in the scene that she has been reduced to a weak state of survival, having been badly treated for (presumably) years.
She was most likely glad to be free of the living hell she was in.

Her smile could be interpreted as a final recognition of her brother, but personally I doubt it - she is confused and dismissive of both the music box and when Suitengu hugs her, it's only moments before we see her hand drop that she smiles.