Here is one of the better troubleshooting guides for the Apple Pencil that may be helpful in working through common issues:
https://appletoolbox.com/apple-pencil-not-working-heres-our-troubleshooting-guide/
As described, your Pencil is exhibiting classic symptoms of a failed battery.
The tiny internal Li-ion battery is susceptible to permanent/irreversible damage through being left discharged for long periods. Even some “new” pencils can exhibit signs of failure out-of-the-box if they are “old stock”. It is essential that if you have an Apple Pencil that you charge it regularly - whether used or not - so as to protect the battery from deep-discharge. Do not allow a pencil to remain in low-charge state for any period of time - as the internal battery will fail, rendering the Pencil useless.
The second generation Apple Pencil should be kept docked with the iPad when not in use - as this ensures that the tiny internal battery is kept healthily charged when not in use.
If the Pencil Battery has failed, the only remedy is to replace the Pencil. If the battery has failed and your pencil is within its one-year warranty, you should look to having it replaced at an Apple Store. If otherwise undamaged and within warranty, Apple generally replace the Pencil without quibble.
I hope this information proves to be helpful in both diagnosing and resolving the problem.