Check the grounds at the headlights.
How much of an electrician are you? Do you have a schematic for the wiring? How about a voltmeter? (Always measure for voltage with one lead attached to where you think the voltage should be and the other to ground. To be sure, go for a battery ground even if you have to run a wire to the negative post of the battery.)
Don't have a voltmeter? Use a spare light the same voltage as your system (12V or 6V) and use it to see if you have voltage. If you have a spare socket to put it in, just add some length of wire to the wires for test leads, or if you dont have a socket you can solder wires to the base and casing. Use a small light, like a tail or turn lamp or something, not a headlamp. Don't want to blow fuses if you test a low current circuit.
Unplug a headlight, turn on the switch and see if you get voltage across the high to ground sides of the headlamp socket. No voltage? Try measuring from each lug of the socket to the battery negative. Voltage now? Definitely a grounding issue.
Try tracing each wire from the headlamp socket to see where it goes. Two should come from the dimmer switch. One should go to a ground somewhere. (Bolted to a fender or something.) Try disassembling the ground and cleaning it up until you have shiny metal on the wire end and the connecting spot on the body or frame.
Got a good ground and no voltage? Go back to the dimmer switch (with the headlight switch still on) and see if you have voltage on the two terminals coming out of it. No? See if there is voltage on the wire going into it. No? Trace that wire back. Should come from the switch. Measure for voltage out of the switch.
With all you've tried, I'd bet it's a bad ground.