Can those 2n3904's handle the current needed by the motor?
The resistor on the base limits current. The idea is to select a base resistor, given the motor current, such that the transistor will be driven into saturation. That's a fancy way of saying that the transistor is really, really on and can't get any more on if it tried.
At the same time you don't want to try and draw more than the max per-pin current out of the MCU drive pin.