In my case, the batteries now take over when the light driven by a generator gets quite dim. Without the diodes, you will fry the delicate relay poles in no time. Capacitors are useless for the purpose. Finding a right charging adapter turned out to be quite tricky. Do not count on the different relay poles to fire simultaneousely.
Solar cells can deliver a respectable charging current in bright sun.
However, the current becomes abysmal under cloudy winter skies. Standard battery holders are not practical on a bicycle. The batteries easily pop out.