Treatment of urinary tract infections (UTIs) and the prevention of their recurrence is a pressing global health problem. During the infection establishment, pathogenic bacteria may attach to and invade into the bladder tissue, and thus access non-planktonic phases besides the bladder lumen. Planktonic, attached, and intracellular bacteria face different selection pressures from physiological responses (frequent micturition and immune responses), or antibiotic treatment. Acknowledging this heterogeneity of selection pressures is essential to increase treatment efficacy, reduce resistance evolution and develop new treatments. Here, we present a mathematical model capturing the initial infection phase to unravel the effects of this heterogeneity on the ecological and evolutionary dynamics of UTIs. We explicitly represent planktonic bacteria in the bladder lumen, bacteria attached to epithelial cells of the bladder wall, and bacteria that have invaded these epithelial cells. We find that access to non-planktonic compartments increases the risk of infection establishment substantially. With antibiotic treatment, the trajectories of resistance evolution are shaped by the accessibility of the intracellular compartment and antibiotic permeation into the epithelial cells. Further, we evaluate conditions where probiotic pretreatment can reduce the pathogen load during an infection and increase the efficacy of accompanying antibiotic therapies. We find that faster-growing probiotic strains achieve a stronger increase in antibiotic treatment efficacy, although too strong antibiotic treatment can diminish this effect. Our study shows that accounting for the selection heterogeneity is crucial to understand the eco-evolutionary dynamics of UTIs, and that mathematical modeling can help to steer this complex system into a healthy state.