Batteries have a much lower specific energy that hydrocarbon fuels to start with, and then that fact that the aircraft weight does not decrease over the duration of the flight is one more disadvantage (currently a second-order issue, given the first difference.)
These are constraints that can be designed around, and you have more freedom to do so when designing from scratch, but doing so is not a optimization, it is a straightforward trade-off between weight and duration. There's no optimal hump on that line.