TL;DR - The specific answer is "NO, N95 masks cannot reliably protect one from the questioned chemicals/compounds". But there's so much more to consider...
This supplemental answer is more broad than the specific, misguided focus on N95 masks. That's not meant to insult, it's meant as recognition of the complexity of the world of safety controls, of which N95 masks are a small part. Even seasoned safety officers, like myself, find that protecting others from myriad dangers is an arduous task requiring years of study, intense application analyses, and quite a lot of human psychology application. Without a good understanding of safety principles, an internet search and a few articles will likely confuse and lead one astray.
N95 Masks
At the very base of the question, any protective mask must be appropriate to the application. "N95 mask" is actually a broad category; there are numerous types of N95 masks created for their specific use. Assuming the question is referencing the type of N95 masks made popular by the COVID-19 pandemic and CDC response, these are masks specific to medical/biological protection applications; they should not be assumed effective in any other application, be it chemical vapors, smoke, radiologics, even other novel biologics for which they have not been specifically tested and approved. In short, if the mask is not made, tested, and approved for the application, then one really has no idea whether it will work.
Even if one has determined a correct mask/respirator type, one still needs to assure that the manufacturer and seller are legitimate. The COVID-19 pandemic and resulting supply glut brought numerous counterfeit masks to the supply chain. https://www.cdc.gov/niosh/npptl/usernotices/counterfeitResp.html.
Research
Another issue with gaining knowledge from internet sources is a misunderstanding of the research process. Research articles may be published, later refuted, found to be flawed with additional research, found to be biased leading to inaccurate conclusions, or may be built upon by additional research and generally accepted as accurate. This is what professional organizations such as CDC, NIOSH, and many others do - they understand the research and apply it appropriately for the world. This process takes years, and is not perfect (because humans are not perfect).
The given research articles generally suggest that frying foods is likely a threat to health. But this needs to be supported by additional research to say how much threat exists, for whom, in what amounts, for what exposure time, and more. Not to mention the relative harm of actually eating the foods discussed. Research additionally needs to support our understanding of appropriate mitigation methods with which the following might help in a general way.
Hazard Controls
While the question focuses on masks, a component of Personal Protective Equipment (PPE), one must understand that PPE is the least effective of safety controls. We use it in hospital settings simply because other, more effective controls are impossible or impractical. See the Safety Controls Hierarchy below from National Institute for Occupational Safety and Health (NIOSH) at https://www.cdc.gov/niosh/topics/hierarchy/default.html :

Simply as a comparative use of the Hierarchy - in hospitals, we cannot eliminate our infectious patients or substitute them for something benign. But we can use the latter three of the hierarchy:
Engineering - we physically isolate particularly infectious patients in rooms with negative airflow.
Administrative - hospitals have policies and procedures, based on supportive research and professional organization known best practices, to direct employees in working safely with infectious patients.
PPE - we wear use-specific masks, gowns, gloves, shoe covers, head covers, hoods, supplied-air respirators, and other PPE as called for by known best practice for the specific infectious agent. This is the last line of defense against transmission of infection from patient to worker.
Applying the Hierarchy of Controls to the specific cooking situation is absolutely appropriate and would be more effective than using a single component (N95 masks) of a single point of the hierarchy (PPE). Suggestions:
Elimination - Remove oils, stoves, and frying pans from your house. Not really practical, as this only leads to substitution because "a man's gotta eat" (Trailer Park Boys - Randy).
Substitution - Cook and eat something different than fried foods. Use a different cooking method that does not involve frying. Eat food known/believed to be more healthy than fried foods. Safety isn't always as fun as doing whatever the heck one wants, but one needs to prioritize. This is also where the human psychology component of safety comes in - I know most people won't eliminate fried foods from their diets, so let's look at some realistic alternatives.
Engineering - Each of us probably already has a hood fan over our stove, but does it vent to the outside? Many don't (in U.S. at least). Is it really effective? Could we open a few windows to help clearing of the smoke/chemicals? Have we changed your hood filters according to manufacturer's recommendations? Could we do most or all of the frying outside? A hood fan will not be completely effective, but can be an important component in our safety controls, especially in commercial applications. This also brings up the question of harm to others if we vent to the outside on a commercial scale, i.e., are we just protecting the workers at the expense of innocent others?
Administrative - As the administrator of our households, we may set rules for all who cook so that appropriate safety controls will be followed. As the administrator of a restaurant or other commercial food production, one may require, through policy, engineering controls and worker safety procedures.
PPE - I think that masks are not necessarily a bad idea for use in cooking, but the mask needs to be the correct type for the given safety hazard else it is a waste of time and money. A few chemicals/compounds were mentioned in the question and each must be accounted for when choosing the correct protection. As a reference, this 3M site details their products appropriate for use in specific applications with specific chemicals: https://www.3m.com/3M/en_US/respiratory-protection-us/applications/ Please note that, although I have received some training from 3M, I am not employed by nor a representative of, and I do not receive compensation from 3M. I am also not specifically recommending their products as there are several other PPE manufacturers with comparable products.
As one finds the respirator/filter types appropriate for exposure to such things as benzopyrenes and formaldehyde as mentioned in the question, one will also likely decide they are not practical (cost and comfort) for personal use, but might be appropriate for daily exposure at a commercial level. Note that assessment of the amount and exposure time of the hazard is necessary to determine how often filters need to be replaced.
Final Notes
We cannot answer the general question of whether N95 masks protect one from cooking chemicals; the question is much too broad. However, I am inclined to opine "heck no".
If one is questioning appropriate mask use in a commercial setting, this raises all sorts of legal issues that I am not about to address. Leave those issues to those who regulate the industry in question. Although, I will note that workers generally have a right in the U.S. to voluntarily wear PPE at their own expense - see OSHA standards for details.
@David West had a great answer. I'm just giving supplemental information for those who may come across this question in the future.