As per the asked question, there can be three different cases, which are given below:

1) P and Q are standing in the same row.

Through the question, we already know that Q is the tallest in her row.

=> Q is taller than P.

2) P and Q are standing in the same column.

Through the question, we already know that P is the shortest in her column.

=> Q is taller than P.

3) P and Q are standing in different rows and different columns.

In this case, let us assume that R is the girl standing in Ps column and Qs row.

Here, Q will be taller than R and R will be taller than P, which implies that Q is taller than P.

Therefore, in any case, Q is taller than P.