Consider the following equation: $$X^{T}AX=X^{T}BX$$ where X is a column matrix, and A and B are square matrices. Such an equation arose in a physical problem, and, thus, from a physics perspective, I know $A=B$. However, I am not able to prove it mathematically and seek your guidance.
Also, is it true in general that for: $$X^{T}AY=X^{T}BY$$ $A=B$, where X and Y are column matrices, and A and B are square matrices?
I assume that by a column matrix you mean a matrix consisting of a single column and $n$ entries. Usually, such matrix is called a column-vector. Then:
The same example works for all skew-symmetric n-by-n matrices. One way to described this is to say that the quadratic form of an alternating bilinear form is identically zero.
At the same time, if you assume that $A=A^T, B=B^T$ then the answer is positive, $A=B$. Indeed, in this case, $A, B$ define symmetric bilinear forms $q_A, q_B$ by the formula $$ q_A(X,Y)= X^T A Y, q_B(X,Y)= X^T B Y. $$ However, every symmetric bilinear form is uniquely determined by the corresponding quadratic form thanks to the identity $$ q(X+Y,X+Y)= q(X,X) + 2q(X,Y) + q(Y,Y). $$ In other words, the function $X\mapsto X^TAX$ of one vector-variable uniquely determines the function $(X,Y)\mapsto X^TAY$ of two vector-variables. The latter function uniquely determines the matrix $A$, see Part 2 below.
One can summarize this as follows: Suppose that $A$ is a square matrix. Then $A$ has unique representation $$ A=S+Q $$ where $S$ is a symmetric matrix and $Q$ is a skew-symmetric matrix. Then the function $$ X\mapsto X^T A X= X^T S X $$ uniquely determines the symmetric part $S$ of the matrix $A$.
$$ X_i^T=(0,...0,1,0,...0) $$ where $1$ occurs in the $i$th place. Then the product $X_j^T A X_i$ equals $a_{ij}$, the ij-th entry of the matrix $A$. Thus, the equalities $X_j^T A X_i=X_j^T B X_i$, $i, j=1,...,n$, imply that $A=B$.
Aside: Why one should avoid using the word "any" when writing math. The word "any" in English sometimes mean "some" and sometimes "every":
The sentence "The illness may be due to any of several causes" when translated to math would be
"There is some cause (from a certain list) that causes the illness in this particular case."
Or the question "Do you know any person (anybody) by the name Bill?" clearly asks if you know just one person with this name (and, likely, you do!), not that you know every person with this name (which, of course, you do not).
Or, if a waitress in a restaurant asks you "Would you like to have any of our deserts?" she clearly means "some" and she does not expect you to eat all the deserts that they have!
At the same time, in your question, you clearly meant "any" as "every", as in the sentence
"These constellations are visible at any hour of the night."