A common fault is with the diodes on the motor. They are 1N4004 or 1N4007, general purpose silicon diodes, and you find them on the outside of the motor casing, semi-sealed in green stuff (like Loctite). Dig them out and you'll probably find that one of the diode legs will fall off. They're cheap to replace and it gives you a good starting point.
You also need to check the fuses. Early-80s X1/9s (with the ceramic fuses) have two very small ceramic fuses for the motors. Later X1/9s with the normal translucent blade fuses have normal fuses for the motors.
It is very important with either type that the relays are correct. If you've been swapping relays around, there's a good chance that they're now the wrong type! Some relays are 'double throw', while the others are 'single throw'. The single type have two terminals connected together on the base, both labelled 87a. Do not use these relays for the headlight motors - you need the double-throw type for the system to work. Check with a multimeter if necessary, to make sure that one contact is normally-closed and the other contact is normally-open.
-Alex