Yes they work... There are a few things to look at, however, and different energy drinks give you that boost through different means (which, BTW has lead to incorrect stereotypes about all energy drinks). There are some kinds that have very little sugar / carbs (or even sugar free), so some of them do not use these carbs to provide the energy. Also, the amount of caffeine varies depending on brand / drink; some have even less caffeine than Mt. Dew (which has the most out of any soda pop at 54mg per 8oz., except for Jolt (if that's still around)). So again the argument that they just have loads of caffeine for its effect isn't always correct either (Red Bull for example has 74mg per 8.3oz can, whereas an 8oz. cup of coffee could have upwards of 100mg). Most energy drinks derive their effect from the added B Vitamins which are used as cofactors in metabolism. Thus the added B Vitamins aid in your body's processing / metabolizing your own energy reserves. Some drinks also have different extracts (like ginseng), although I'm not sure how these extracts effect the body.
As for the effect on your heart, I am unsure... Some B Vitamins are actually supposed to be good for your heart (niacin comes to mind), but I'm not sure if that includes all of the different B Vitamins found in energy drinks, nor do I know whether the amounts they put in those drinks are still considered good for your heart (most levels in the drinks are over 100% of your daily allowance). The carbs may play a factor, esp. if one's heart condition is related to diabetes, so low carb drinks are probably better than the sugared ones. Also, the caffeine may play a role, but if its under 100mg then it's probably about the same as coffee (coffee usually ranges from 75mg to 200mg, depending on preparation).