Historically, medieval peasants had very limited academic knowledge
Education was largely viewed as a matter of necessity (or lack thereof) - people learned only what they needed to in order to go about their lives, and no more. Farmers and many types of craftsmen were often not literate, as they did not need to be.
Most people understood some level of math, though on a very basic level. People would know how to count in positive whole numbers, but would not understand negative numbers, fractions, or possibly even the concept of zero.
A lot can be implied from the mechanics of the Education feat
(Although the feat in question is from a different Edition of D&D, the logic still applies to the campaign setting in a system-agnostic way.)
The Education feat, from The Forgotten Realms Campaign Setting book (D&D 3.5) represents a formal schooling of the sort you mention. It is a "backstory" type feat, only allowed to be taken at 1st level and representing one's experience as a youth.
It is a feat that is very rarely seen in NPCs and has somewhat strict racial and geographical requirements. Only a few locations offer such educations. Its mechanical rarity implies its in-universe rarity. Few (or possibly no) canon NPCs have this feat.
The description of the feat reads as follows:
You hail from a land where the pen is held in higher regard than the
sword. In your youth, you received the benefit of formal schooling of
The prerequisites section goes on to list a handful of areas per race that this could plausibly apply to:
Prerequisite: Elf (Evermeet, Silverymoon, or Snow Eagle Aerie), gnome
(Lantan), half-elf (Silverymoon), or human (Chessenta, Lantan,
Silverymoon, or Waterdeep).
This feat is only applicable to a portion of people living in some select areas. Additionally, only a small fraction of people who are capable of this feat would be likely to take it. Assuming that these mechanics accurately represent the game world in-universe, it would appear that very few people receive such educations.