If you use a TM on yourself or your partner Pokemon in a Special Episode, and then restart that Episode, then the Pokemon would not know the TM move.
The reason for this is that you only have one save file for playing the Special Episodes. As Bulbapedia phrases it:
Players may only have a save file for one Special Episode at a time. Selecting another Special Episode from the list will overwrite the save data, resulting in a loss of all items and money not in storage or the bank.
When you overwrite your save file, everything you did in your previous save is lost, even teaching yourself or your partner TM moves. The same is true if you complete a Special Episode and then restart the same Episode.
To make sure that the Pokemon actually forget TM moves, I decided to test this myself. I played the Episode Bidoof's Wish and taught myself Facade and my partner Snover Hail with TMs (I own a virtual console version ofExplorer's of Sky on Wii U). I kept Facade throughout the entire dungeon and, after finishing the Episode, I restarted the Episode. As expected, Bidoof had it's usual moves (Tackle, Growl, and Defense Curl), but it did not have Facade at the start of the dungeon. Snover also had its original four moves (Grass Whistle, Swagger, Icy Wind, and Powder Snow).
Sources: playing the game myself and Bulbapedia
Hope this answers your question!