But what player can say that they know the entirety of their character’s knowledge? That’s the issue.
Sure there are going to be things that a fictional person in a fictional world may have "common knowledge" of that the player might not. That's where you ask the GM, "Would my character know about X?" The GM may say "yes", or "Let's see, make an IQ roll at -2", or "Do you have the Lore: X skill?".
OK, let me try it another way: what do you anticipate as a likely outcome to this inquiry?
We're talking about a very specific context of inquiry here: the PC is in a combat, declaring combat-type actions (including attacks in most cases); the PC almost certainly knows that fire is a viable attack form; the player knows that fire is a required attack form.
When, and under what conditions, is the player entitled to decide that his/her PC uses fire?
Again, if I were running such an encounter (and I'd like to stress that I personally don't like this hypothetical b/c I've never run a game where Trolls were outside of "common knowledge"), it would likely go something like this:
As the GM I would not tell the players that they were fighting a troll. They would only know what the characters can see, ie "a large greenish humanoid with long arms and sparse stringy hair" or something similar. Even if the players assume it is a troll, it might not be, it could be some sort of mutant ogre or hobgoblin. The key points are that (A) the characters don't recognize what the creature is and (B) the players don't know for certain what it is.
If the players go ahead and assume that it is a troll, and use that metagame knowledge to immediately attack with fire, I'd stop the game ask why their character would do that, and only allow it if the player could convince me that this is what the character would naturally do, and not based on the player's knowledge. This might be where they find out they are NOT dealing with a troll and that throwing fire at random green humanoids is a bad idea. Maybe it was a Green-tar man, and now is a flaming green-tar man!
Otherwise if they proceed into combat in what is a normal fashion for the group. Then after a few turns they will learn that the creature is healing very rapidly. I'd probably also tell anyone with any form of "magical sensitivity" to know that the healing doesn't seem to be magical.
With that knowledge the players might think, "what would my character do?" The answer might be:
1) "We should run as we can't hurt this thing! Maybe back in town we can find someone that has encountered such a beast and can tell us what it is and how to beat it."
2) "Maybe we can try to deal damage faster than it can heal."
3) "Maybe a different types of damage might prevent it from healing. Fire and Acid scar the flesh so that might work!"
2 is a risky proposition, but if the character is the "berserker" type they may opt for it. 1 probably would appeal to the scholarly type, or more injury adverse characters. And 3 is probably going to work for most characters that don't see a better option.
But what is chosen and the exact reasons why are up to the player, and what they think that their character would be likely to do. That's good roleplaying.
In the games I typically play, good RP is better than killing the monsters. I give XP, CP, epps, for roleplaying not for slaying monsters. If at your table there is more "game" where killing monsters is more important than character motivations and story, then maybe using whatever you can to "win" works for you. That's not how I run games, and it is not how the people I game with play their characters.