The Ward
(2010)

Anyone who has seen IDENTITY should know this has a similar twist ending.

Kristen is the only occupant of the ward left standing after all the other girls either die or disappear due to the undead Alice.

After slamming a fire axe into her, she reaches the safety of Dr Stringer's office where she discovers that Alice has Multiple Personality Disorder (brought on from an abduction, confinement and implied abuse) and that she is really a personification of one of Alice's personalities like all the other girls were.

The other personalities overwhelmed her own identity which has since been fighting back, removing the other personalities one by one. Alice shows up and both fall out of a high stories window. Kristen seemingly dies and Alice is herself again. However, later on in her room, Kristen shows up and violently takes control of Alice's body once more.

Thanks ND Woods!