Yes, sounds like when you pedal it tries to engage the motor, which of course loads the battery, hence the lights go out.
This maybe because the lights are faulty (i.e. showing the battery lower than it is) or more likely the battery is dead, or the connections between battery and controller...