Weather effects, status, Leech Seed, trap move damage etc. all occur at the end of the turn after the Pokemon's attack landed, so they would not work it this situation (it would be a loss for the Pokemon KO'd by the attack), unless both Pokemon faint for these reasons which in that case see below.
But if things like recoil are in play, and both of the last Pokemon are knocked out, how it is treated depends on what battle you are in.
- If it's an online or competitive battle, the battle will be a draw.
- If it is in game against an NPC trainer, it will be treated like a loss and you will be sent back to the Pokemon Centre. You can't walk around with a team of fainted Pokemon of course.