Ok, so the right way to think about this is to consider the maximal filtration generated by $W_1$ and $W_2$. This consists of $0,W_1\cap W_2,W_1,W_2, W_1+W_2,V$. Let these have dimension $0, a, a+b, a+c, a+b+c,a+b+c+e$ and let their intersection with the fixed subspace have dimension $0,a',a'+b',a'+c',a'+b'+c'+d', a'+b'+c'+d'+e'$

This is a relabeling of your parameters except i have added one new variable. Then such a subspace gives:

An $a'$-dimensional subspace of the $a$-dimensional $W_1 \cap W_2$

A $b'$-dimensional subspace of the $b$-dimensional $W_1/(W_1\cap W_2)$

A $c'$-dimensional subspace of the $c$-dimensional $W_1/(W_1\cap W_2)$

Two $d'$-dimensional subspaces, one of $W_1+W_2/W_2$ modulo its $b'$-dimensional subspace, and one of $W_1+W_2/W_1$ modulo its $c'$-dimensional subspace, and an isomorphism between them.

An $e'$-dimensional subspace of the $e$-dimensional $V/(W_1+W_2)$.

A bunch of extension classes.

Other than the extension classes we just get a $q$-analogue of

$$\pmatrix{ a \\ a'}\pmatrix{ b\\ b'}\pmatrix{ c\\ c'}\pmatrix{ b-b'\\ d'}\pmatrix{ c-c' \\ d'}\pmatrix{ e \\ e'} (d'!)$$

And the extension class is

$$p^{(b'+c'+d')(a-a')+e'(a+b+c-a'-b'-c'-d')}$$

Then you can sum over $d'$ to get the answer to your problem.

Messy version:

Given such a subspace, we can choose a basis consisting of

- $r'$ vectors in $W_1 \cap W_2$
- $n_1-r'$ additional vectors in $W_1$ that remain linearly independent in $W_1 / (W_1 \cap W_2)$
- $n_2-r'$ additional vectors in $W_2$ that remain linearly independent in $W_2 / (W_2 \cap W_2)$
$\alpha$ additional vectors in $W_1+W_2$ that, modulo the $n_1+n_2-r'$-dimensional subspace spanned by the previous vectors, do not intersect the $m-n_1$-dimensional image of $W_1$ or the $m-n_2$-dimensional image of $W_2$.

$\beta$ additional vectors in $V$ that remain linearly independent in $V/(W_1+W_2)$.

where $\alpha+ \beta=k-n_1-n_2+r'$.

It's easy to count the number of possible lists of vectors for the first three, and the number of choices in a fixed subspace. I think it's $$\left[\matrix{ r \\ r'} \right]_p \left[\matrix{ m_1-r \\ n_1-r'} \right]_p \left[\matrix{ m_2-r \\ n_2-r'} \right]_p p^{(r-r') (n_1+n_2-2r')} $$ (A simpler argument along these lines gives a proof of the identity Richard Stanly mentions in the comments)

Similarly for the fifth one

$$\left[\matrix{n-m_1-m_2+r \\ \beta}\right]_p p^{\beta (m_1+m_2-r-k+\beta)}$$

So it remains to see how much the fourth kind of vectors increases the count. Each successive vector of the fourth type we choose must avoid two subspaces - $W_1$ plus the previous vectors and $W_2$ plus the previous vectors. We can count these using inclusion-exclusion because we know the intersection of each type of subspace with the others, as the new vectors we are adding at the fourth step increase the dimension of each by one and the dimension of the intersection by two.

$$\prod_{i=0}^{\alpha-1} ( p^{m_1+m_2-k} - p^{m_1+ n_2-k' + i} - p^{m_2+ n_1-k' + i}+ p^{k+n_1+n_2-2k' +2i})=\prod_{i=0}^{\alpha-1} (p^{m_2-n_2+k'-k-i}-1)(p^{m_1-n_1+k'-k-i}-1)p^{k+n_1+n_2-2k'+2i}$$

The denominator is given by a simpler formula - the number of choices for the remainder of the basis is just $$(\alpha!)_p p^{ \alpha (n_1+n_2-r')}$$

$$\left[\matrix{ r \\ r'} \right]_p \left[\matrix{ m_1-r \\ n_1-r'} \right]_p \left[\matrix{ m_2-r \\ n_2-r'} \right]_p p^{(r-r')(n_1+n_2-2r')}\sum_{\alpha+\beta=n_1+n_2-k'}\left[\matrix{m_2-n_2+k'-k \\ \alpha} \right]_p \left[ \matrix {m_1-n_1+k'-k \\ \alpha}\right]_p (\alpha!)_p\left[\matrix{n-m_1-m_2+r \\ \beta}\right]_p p^{\alpha(k+n_1+n_2-2k'+\alpha-1) +\beta (m_1+m_2-r-k+\beta)}$$

Note that as $p$ goes to $1$ this becomes a perfectly ordinary product of binomial coefficients, because the $\alpha!$ vanishes for $\alpha$ nonzero.

Enumerative Combinatorics, vol.\ 1, second ed. $\endgroup$8more comments