The fast-changing Brazilian urban reality segregates people in socio-spatial terms and distributes urban public resources unfairly, threatening student's access to the structure of educational opportunities and causing school inequalities. Factors such as the existence of public lighting, open sewage and garbage accumulated around the homes, as well as electricity and water supply, sanitation, and the number of residents per bathroom, are discussed as predictors of school achievements as measured using their average IDEB (Basic Education Development Index) outcomes using Data Science methods. It was found that the resident/bathroom density and the household wall material indicators in a municipality have a higher correlation with its average school achievements than the average students' socioeconomic status, relations that are clearly illustrated through bivariate choropleth maps across all the 5,388 Brazilian municipalities with available valid data. These results are compatible with research that reveals the presence of a "neighbourhood effect," such that the distributional inequalities in infrastructure access and ultimately the notion of urban welfare reduces educational opportunities and engenders social inequalities, what is incompatible with the ideal of a sustainable society.