We present the results of HI and OH absorption measurements towards a sample of radio sources using the Arecibo 305-m telescope and the GMRT. In total, 27 radio sources were searched for associated 21-cm HI absorption. One totally new HI absorption system was detected against the radio galaxy 3C258, while five previously known HI absorption systems, and one galaxy detected in emission, were studied with improved frequency resolution and/or sensitivity. Our sample included 17 GPS and CSS objects, 4 of which exhibit HI absorption. This detection rate of ~25% compares with a value of ~40% by Vermeulen et al. for similar sources. We detected neither OH emission nor absorption towards any of the sources that were observed at Arecibo, and estimate a limit on the abundance ratio of N(HI)/N(OH)>4x10^6 for 3C258. We have combined our results with those from other available HI searches to compile a heterogeneous sample of 96 radio sources consisting of 27 GPS, 35 CSS, 13 flat spectrum and 21 large sources. The HI absorption detection rate is highest (~45%) for the GPS sources and least for the large sources. We find HI column density to be anticorrelated with source size, as reported earlier by Pihlstrom et al. The HI column density shows no significant dependence on either redshift or luminosity, which are themselves strongly correlated. These results suggest that the environments of radio sources on GPS/CSS scales are similar at different redshifts. Further, in accordance with the unification scheme, the GPS/CSS galaxies have an HI detection rate of ~40% which is significantly higher than the detection rate (~20%) towards the GPS/CSS quasars. Also, the principal (strongest) absorption component detected towards GPS sources appears blue-shifted in ~65% of the cases, in agreement with the growing evidence for jet-cloud interactions.