This really is just called a variation and it's not limited to soundtracks, Wikipedia says:
In music, variation is a formal technique where material is repeated in an altered form.
A famous example of this are the Goldberg Variations.
A Leitmotif is by definition the leading theme of the overall piece, which would be the film in this case, so it may be the main character's theme tune, or the title theme, which is then the most likely candidate to be the tune which is varied throughout the rest of the film depending on the tone of the scene or emotional state of the character(s).