On further study of the shape water spell (from Elemental Evil), it says that you are able to freeze water as an action, so if you transform it into ice (expanding the water in the process), could you repeat use of it to slowly erode such things as locks or hinges, breaking them enough so they become inoperable?
Purely at the permission of your GM. It's physically reasonable, but clearly outside the wording of the spell. Some GMs will look at that an say, "that's a clever idea, sure." others will look at it and say "that's clearly more powerful than the spell is intended to be, no." 5e gives a lot of latitude to the GM in terms of rule interpretation. So if it's not clearly covered by the spell description, it's up to the GM's interpretation.
As a comparison, Arcane Lock is a second level spells that locks doors and/or windows (with some other benefits) so you're talking about using a cantrip in place of a 2nd level spell, which a DM may say is over powered.
If I were GM I'd point out that a key part of this spell is "the water unfreezes in one hour". This means that you'd need to wait for the water to unfreeze each "cycle" or find some other way to melt the water. In this way it sounds possible and probably more difficult than dealing with the problem manually (a big rock) which is about on par with a cantrip. It certainly sounds like a plan if your character was locked in a dungeon with no equipment for a few weeks.