The two options you have given here are equally painful. You don't love someone but you being with the person for whatever reason is unjustice to yourself, as well as to the other person. You love someone but can't be with that person will make you emotionally drenched, not sure about the other person as that person may not desire you.
In both ways, your own happiness will be compromised. We can still make a choice to end a relationship that isn't worthy and be free from being in a dead relationship, free from being with a person you don't love.
But feelings, emotions are not always under our control, we sometimes end up loving a person whom we know we can never be with us. It's so painful, believe me, it hurts so deeply. But eventually, we have to let the person go, with the pain deep buried in our heart.
I have been through both, I have stuck in a marriage with a person I don't love. And I love one of my friends who most probably doesn't care about my feelings. Both the situation is emotionally making me stressed and dried. So I'm trying to free myself from my marriage for a better future, for my own happiness. And I know i have to let my friend go, he can't be mine. Deep down in my heart, I'll remember him but there's not much I can do!! I have to find my own happiness in some other way.