Two polynomials are equal, if and only if they have the same coefficients and degrees for the corresponding terms (or they can be so arranged.)
A polynomial equation is when both sides of the equation is a polynomial expression.
These are two different mathematical statements, but strangely, I cannot think of a way to express these two statements with different notations so that the difference is clear.
When we write a polynomial equation, in which both sides of the equal sign is a polynomial expression, this represents an equation to be solved for the variable(s) in question, but does not mean the actual polynomial expressions are equal, the conditions for which I have given above.
If so, how do we express mathematically that two polynomials are equal and that we are not talking about an equation?


Q: "... how do we express mathematically that two polynomials are equal and that we are not talking about an equation?"
A: Normally, with words.
Usually something like "We know that for all x ..." for the first case, and "Solve ..." or "Find all $x$ such that ..." for the second case. Often there is enough context that it is clear which is intended without being explicit, but to your generic question that's the answer.
If you like being pedantic, you can write
$$ \forall x \,\,\,\,\,p_1(x) = p_2(x) $$ and $$ \{x \mid p_1(x) = p_2(x)\} $$ respectively, but you don't gain much clarity with these. Maybe a computer program might prefer them, but most humans like words.
Edited to add, replying to comment:
Adding the quantifier might resolve everything for a polynomial in one variable, but you might want to think about what's going on if you have functions of two variables, and you are asked for:
Again, you can encode this with just notation by considering $$\{y \mid \forall x \,\,\,\, p_1(x,y) = p_2(x.y) \}$$
Maybe we can broaden your comment to say that we only have clarity when there are no free variables left. But note that the traditional definition of a free variable is one without a $\forall$ or $\exists$ modifier, and we broaden that to include "set of all $x$ such that ...".