The difference is that "hardly" means something is true to a degree which is unimportant or insignificant. Basically, you are saying something is true but is no different than if it was not true.
"Barely" means almost not true (but is still true). Also it can still be significant or important. It is more positive than "hardly".
For example, if you said "I hardly have enough money to buy that," you probably mean "I can't or won't buy that." If you said "I barely have enough money to buy that," you probably mean "I can or will buy that, but then I will have no money or very little money."