Standard deviation and coefficient of variation are both measures of dispersion of a distribution, but which one is more useful will depend on context. SD is widely applicable, but there are situations where you definitely should not use CV.
Some measurements are taken on an interval scale, meaning that there's no true, non-arbitrary zero point on the scale - you can really only compare differences in measurements. Temperature, for example, could be on an interval scale, since 0 degrees F and 0 degrees C are both equally valid, and the zero point has no special meaning (although measuring temperature in Kelvin has a non-arbitrary zero and therefore isn't an interval measure). For anything measured on an interval scale, coefficient of variation is rather meaningless, since you could shift the scale to any numerical value arbitrarily and get an entirely new CV - there's no reason why you should prefer a CV measured in Fahrenheit rather than Celsius, suggesting that it's not a useful measure. CV should only be used for ratio scales for things like mass or length that have a non-arbitrary zero point.
If the data is on a ratio scale, CV and SD are both acceptable, but must be interpreted differently. In your example, both A and B have identical SD, indicating their variation is the same in an absolute sense. The difference in means results in different CVs, however, so dataset A has greater dispersion in a relative sense, in that the distribution varies more widely as a percentage of the mean.