We investigated the molecular and ecological mechanisms involved in niche expansion, or generalism, versus specialization in sympatric plant pathogens. Nopaline-type and octopine-type Agrobacterium tumefaciens engineer distinct niches in their plant hosts that provide different nutrients: nopaline or octopine, respectively. Previous studies revealed that nopaline-type pathogens may expand their niche to also assimilate octopine in the presence of nopaline, but consequences of this phenomenon on pathogen dynamics in planta were not known. Here, we provided molecular insight into how the transport protein NocT can bind octopine as well as nopaline, contributing to niche expansion. We further showed that despite the ability for niche expansion, nopaline-type pathogens had no competitive advantage over octopine-type pathogens in co-infected plants. We also demonstrated that a single nucleotide polymorphism in the nocR gene was sufficient to allow octopine assimilation by nopaline-type strains even in absence of nopaline. The evolved nocR bacteria had higher fitness than their ancestor in octopine-rich transgenic plants but lower fitness in tumors induced by octopine-type pathogens. Overall, this work elucidates the specialization of A. tumefaciens to particular opine niches and explains why generalists do not always spread despite the advantage associated with broader nutritional niches.