The general answer to this question is "very easily". It's common for two molecules to have very similar properties, so that they're hard to separate. Even if they have different properties, separating them completely may not be easy (e.g. a mixture of 96% ethanol and 4% water has a fixed boiling point, so it's impossible to get pure ethanol by distillation).
In this case, it's even worse because we aren't talking about pure chemistry: we're talking about molecules that are necessary for human bodies, and human bodies are complex. The discovery of vitamins is linked to the study of food deficiencies: why does eating lemons prevent sailors from getting scurvy? Because lemons contain a molecule necessary for human life (vitamin C, also called "ascorbic acid" which literally means "acid that prevents scurvy"), and the typical sailor diet was otherwise low in this molecule.
In this case, all vitamins in the B group tend to occur in the same kinds of foods. Casimir Funk discovered that some kinds of food helped prevent beriberi, and he assumed that they contained a molecule necessary for human life, which he called a "vitamin". He was only half-right, because they actually contained several of them.