Here's how this works.
In this game, there are on-hit effects and spell effects. On-hit effects are applied when a basic attack lands and spell effects are applied when a damaging ability lands. Of course, there are some exceptions to this, and although I will not go into all of them, the main one is that there are abilities that specify that they apply on-hit effects. Examples of these abilities are Ezreal's Q, Gangplank's Q, and Irelia's Q. Now, you can only apply one or the other between on-hit and spell effects, not both, and since these abilities already specify that they apply on-hit effects, they DO NOT apply spell effects.
Now, for the mastery Deathfire Touch, yes, the tool tip does say that "damaging abilities" will apply it. Basically, this means that Deathfire Touch is considered a spell effect, so it will apply on damaging spells. However, because Ezreal's Q specifies that it applies on-hit effects, it will not apply spell effects, and since Deathfire Touch is considered a spell effect, Ezreal's Q will not apply it.
This is working as intended, and is also the reason why Ezreal's Q will not apply Luden's Echo's bonus damage or Rylai's Crystal Scepter's slow.