yes it must work but i think this simple circuit has some disadvatages like
the voltage drop across each transistor = 0.7
total loss = 0.7 + 0.7 = 1.4v
maximum voltage across the moter will never exceed 12-1.4 = 10.6v,
use heatsinks
It will work but you won't want to run more than maybe
1W through that TIP31 without heat sinking, or more than
10W without a fan on said heat sink.
There are many people selling small PWM motor control
boards & kits, which are a lot more efficient. If this was a
battery-powered application you'd want to go that way for
much greater battery life.