If both trainers are down to their final Pokemon, and a suicide attack is used, the one who used that suicide move is the winner. It's just the way the Shoddy Battle team and Game Freak coded it, so that slower, bulkier Pokemon who learn these attacks can still revenge kill, in a sense.