You should be able to do what you want
The Animate Objects spell allows your PC to use a bonus action to mentally command the animated flasks to take an action. It also specifies that:
You decide what action the creature will take...
This means that you may command the creature—in this case, an animated construct—to take the Use an Object action, or even to take
an action that you improvise.
In this particular case, using the item requires an attack. Fortunately, the object is capable of making an attack:
If you command an object to attack, it can make a single melee attack against a creature within 5 feet of it.
The can in the above clause does not necessarily mean the attack can only be a single melee attack. Therefore, the flasks should be able to splash their own contents "onto a creature within 5 feet of" themselves according to the normal Use an Object and Holy Water rules. Since the flask only "shatters on impact" if thrown, you should be able to command them to attack on subsequent turns.
Since Holy Water defines the attack as both ranged and improvised, you would use the animated construct's Dexterity (c.f. this discussion), which in this case would be 18, according to the chart provided in the spell.
Furthermore, since the flasks have a flying speed of 30, it might be reasonable to command them to improvise an action by hovering upside down over the target in order to spill their contents on it. However, your DM may need to adjudicate this, as detailed in the rules:
IMPROVISING AN ACTION
Your character can do things not covered by the actions in this section, such as breaking down doors, intimidating enemies, sensing weaknesses in magical defenses, or calling for a parley with a foe. The only limits to the actions you can attempt are your imagination and your character’s ability scores. See the descriptions of the ability scores in the Using Ability Scores section for inspiration as you improvise.
When you describe an action not detailed elsewhere in the rules, the DM tells you whether that action is possible and what kind of roll you need to make, if any, to determine success or failure.
In this case, it would be reasonable to use the parameters for attacking with an improvised weapon, such as a range of 20/40.
Interestingly, the rules for holy water seem to omit the clause "on a hit..." Compare this to the wording for a vial of acid:
On a hit, the target takes 2d6 acid damage.
This omission was almost certainly an oversight on the designer's part. You likely will need to hit with the ranged, improvised attack in order to deal the 2d6 radiant damage.
Finally, you may consider a similar approach with other objects, e.g., vials of acid or alchemist's fire, for non-undead (i.e., living) targets.