Hello grassman,
I suppose this depends on what you mean by beans and which state they are in; Dr William L Esser was of the opinion that beans in their dried state are decidedly acid-forming and difficult to digest, resulting in the flatulence/gas you speak of, and didn't support their consumption except in the fresh state, when they are more easily digestible and of use to the body.
The evidence for consuming garlic is said to be beneficial to health as you mention, and classed by some as a superfood................ http://www.garlic.mistral.co.uk/