Given your confidence in the Pencil battery status, here is one of the better troubleshooting guides for Apple Pencil:
https://appletoolbox.com/apple-pencil-not-working-heres-our-troubleshooting-guide/
Assuming that you do not have any other iPad charging issues - and that the Lightning Port of your iPad is free from debris - whilst the Pencil is plugged-in to the Lightning Port of your iPad, verify that the Pencil is recognised:
Settings > General > About
Scroll to the bottom of the page - and you should find entries for the Pencil (iPadOS13 and earlier: one each for the physical and Bluetooth connections. iPadOS14: sometimes only one entry). Finding these listed entries suggests that the Pencil electronics are good - otherwise, you have a totally dead pencil.
Check the Battery Widget for the charge status of the Pencil. Is it 100%? If not, let the Pencil charge; if it is fully charged, disconnect from the iPad.
When disconnected from iPad, does the Pencil disappear from the Battery Widget - or it’s indicated state of charge suddenly fall? If either of these are true, then the Pencil battery is likely to be failing or dead.
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. Setting aside an unused Pencil, for extended periods, is a recipe for premature death of the Pencil battery.
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 by your retailer or at an Apple Store.
I hope this information proves to be helpful in both diagnosing and resolving the problem.