Preheat oven to 350°F and lightly coat a 1-quart baking dish with nonstick spray. Drain beans and set aside. If using canned beans, make sure to rinse them.
In a saucepan over medium heat, add the olive oil. Once the oil is hot, add the onion and sauté 5 minutes. Add the garlic and cook another 30 seconds, until fragrant.
Add the rest of the ingredients and simmer 5 minutes, stirring to dissolve brown sugar and blend ingredients together.
Stir in beans, coating with sauce, then pour everything into the prepared pan. Cover with foil and bake for 30 minutes, then remove foil and bake another 10-15 minutes, until thickened. Let cool slightly before serving.