DIAGNOSIS The battery is either severely degraded (won't hold a real charge) or, more likely, one or more cells are out of balance. The charger reads surface voltage as 'full,' but under the load of the mower, it instantly plunges.
FIX Try a 'reconditioning' cycle. Leave the battery on the charger for a full 24 hours after it shows green. The Ryobi charger has a balancing function that can sometimes revive a slightly impaired pack if left long enough. Then run it in the mower until it quits, and charge it fully again.
IF THAT DIDN'T WORK Test the battery in another 40V Ryobi tool, like a leaf blower. If it also dies quickly there, the battery pack is finished. If it works fine in another tool, the problem might be the mower's high current draw—check for a clogged deck or a dragging brake (see the next issue) making the motor work way too hard.
HEADS UP Storing these lithium batteries fully charged or completely dead for long periods (like over winter) is the fastest way to kill them. For storage, charge them to about 50-75%.