Speaking as someone who has been admitted twice to inpatient mental facilities for suicide attempts and has experienced the dissolution of relationships that such actions entail, I want you to know two things:
1) Despite what your brain tells you--and how loudly it tells you this--you must not hold yourself responsible for what happened to him. At the risk of sounding insensitive, you must understand that you do him a disservice by placing his fate on your own shoulders. His life experiences and his thoughts were his own, and no amount of sheltering and rescuing you think you could have done would have saved him from himself. If someone wants out, whether in a quick act of desperation or through a slow and painfully self-destructive process, they will get there. Throwing yourself on this particular grenade would have only taken both of you out, and I think that deep down, both you and he knew this. You left an overtly abusive relationship, but you also had the foresight to leave your relationship with him as well, which had the potential to become emotionally crippling as well. Do not look at this as deserting him; if he was fated to live a miserable existence, then it would have done neither of you any good for you to stay with him. Recall the myth of Sisyphus.
2) While you may think you were such a horrible friend and failed lover for deserting him, I can guarantee that in his final moments, in his heart of hearts, he would probably cite you as the best thing that happened to him. I imagine that if he knew the pain that you were in right now, he would feel just as guilty as you do for "allowing" him to die (note the air quotes). You were there for him at his lowest, and if you believe in an afterlife, then I can guarantee that he will remember his time with you as the high point of his life. Those highs were clearly not enough to balance the lows, though, and again--you must not blame yourself for this. I imagine his spirit coming to you and, unseen, thanking you for everything you were to him before departing for the other side--rather than haunting you for what you weren't.
I know that my words are but one set of many you will be receiving, but I do hope that they can reach through to you. Dealing with loss is exceptionally hard, but it's borderline unbearable when you feel survivor's guilt. I encourage you to reach out to those whom you can trust; there are trained professionals who deal with helping others overcome loss and the guilt left behind to suicides. Grieve, but grieve no longer than you must. Do not forget that you still have the task of living your life. If you truly want to make it up to Brandon, then you need to live the fullest life that you can--the life that neither he nor you allowed yourselves to live. It's what he would want for you.
I'm just a stranger, but I'm willing to talk via PM if you want. Best of luck to you.