There are many ways to give them cantrips but the RAW is limited to these as far as i know:
If the rogue chooses the Arcane Trickster he gets the ability to cast mage hand and learn two additional cantrips from the wizard spell list which includes Prestidigitation. PHB 97-98
If the DM allows the players to take feats any character can get the Magic Initiate feat, allowing the character to learn 2 cantrips from a class enabling them to acquire the Prestidigitation spell. PHB 168
There are more ways if you don't mind homebrewing:
Especially if you are the DM and the ability to cast Prestidigitation is a game changer for the current scenario/quest. Either way, if you want your players to have something... Give it to them.
I thought of two magical items as i wrote this answer:
The Wizards' Hat
While attuned to this item you rapidly grow a magnificent white beard. You can cast the Prestidigitation cantrip (once? twice? no limit?).
Maybe add in some other stuff if anyone is actually interested in spellcasting.
Potion of Wizarding
While affected by this potion you can cast the Prestidigitation cantrip. Add your proficiency bonus to Intelligence(Arcana) checks, double if you are already proficient in Arcana.
Also you can give them a weaker version of an Ioun Stone, Reserve. DMG 176
It basically stores spells so you can cast them later. This would be the easiest solution if the players only need a couple of prestidigitation casts before accomplishing their goal.
By RAW spell scrolls wouldn't help the party as they need to have the cantrip in their class spell list to use the scroll:
A spell scroll bears the words of a single spell, written in a mystical cipher. If the spell is on your class's spell list, you can use an action to read the scroll and cast its spell without having to provide any of the spell's components. Otherwise, the scroll is unintelligible.