SummaryWe develop a low‐rank tensor decomposition algorithm for the numerical solution of a distributed optimal control problem constrained by two‐dimensional time‐dependent Navier‐Stokes equations with a stochastic inflow. The goal of optimization is to minimize the flow vorticity. The inflow boundary condition is assumed to be an infinite‐dimensional random field, which is parametrized using a finite‐ (but high‐) dimensional Fourier expansion and discretized using the stochastic Galerkin finite element method. This leads to a prohibitively large number of degrees of freedom in the discrete solution. Moreover, the optimality conditions in a time‐dependent problem require solving a coupled saddle‐point system of nonlinear equations on all time steps at once. For the resulting discrete problem, we approximate the solution by the tensor‐train (TT) decomposition and propose a numerically efficient algorithm to solve the optimality equations directly in the TT representation. This algorithm is based on the alternating linear scheme (ALS), but in contrast to the basic ALS method, the new algorithm exploits and preserves the block structure of the optimality equations. We prove that this structure preservation renders the proposed block ALS method well posed, in the sense that each step requires the solution of a nonsingular reduced linear system, which might not be the case for the basic ALS. Finally, we present numerical experiments based on two benchmark problems of simulation of a flow around a von Kármán vortex and a backward step, each of which has uncertain inflow. The experiments demonstrate a significant complexity reduction achieved using the TT representation and the block ALS algorithm. Specifically, we observe that the high‐dimensional stochastic time‐dependent problem can be solved with the asymptotic complexity of the corresponding deterministic problem.