That might help with the mold but not necessarily with any unwelcome and unwanted bacteria and yeast that have had an opportunity to grow in the diluted solution of water plus whatever was already in the barrel. You would have to separately deal with the yeast and bacteria to the extent you can get them fully out of the wood, which you probably cannot.
It also won't help with any compounds produced by the molds and whatever else is in there that have soaked into the wood and will not easily be removed. Remember that, just like the wine/spirit/beer that remains in the wood after it was initially drained, those compounds producing the foul odors now are also soaked into the wood.
You could try it but you might find yourself dumping the batch of beer and the barrel.