Deterministic continuum models formulated in terms of non-local partial differential equations for the evolutionary dynamics of populations structured by phenotypic traits have been used recently to address open questions concerning the adaptation of asexual species to periodically fluctuating environmental conditions. These deterministic continuum models are usually defined on the basis of population-scale phenomenological assumptions and cannot capture adaptive phenomena that are driven by stochastic variability in the evolutionary paths of single individuals. In this paper, we develop a stochastic individual-based model for the coevolution between two competing phenotype-structured cell populations that are exposed to time-varying nutrient levels and undergo spontaneous, heritable phenotypic variations with different probabilities. The evolution of every cell is described by a set of rules that result in a discrete-time branching random walk on the space of phenotypic states. We formally show that the deterministic continuum counterpart of this model comprises a system of non-local partial differential equations for the cell population density functions coupled with an ordinary differential equation for the nutrient concentration. We compare the individual-based model and its continuum analogue, focussing on scenarios whereby the predictions of the two models differ. Our results clarify the conditions under which significant differences between the two models can emerge due to stochastic effects associated with small population levels. These differences arise in the presence of low probabilities of phenotypic variation, and become more apparent when the two populations are characterised by less fit initial mean phenotypes and smaller initial levels of phenotypic heterogeneity.