Hello m0atz,
If both last pokemon faint at the same time, the user which used an self-damaging move(+moves with lifeorbs) will lose; such as Brave Bird or any move combined with Life Orb.
previously I did face this same situation and I use brave bird, but I won, they change something on this?
I am not entirely sure but I won a game because of this glitch ( enemy dragonite died duo to lifeorb damage )
I have to actually test it myself in order to say more about it but all I know is that it is acting weird sometimes, not sure if it is indented like that or not