Echo chambers are defined by the simultaneous presence of opinion polarization with respect to a controversial topic and homophily, i.e. the preference of individuals to interact with like-minded peers. While recent efforts have been devoted to detecting the presence of echo chambers in polarized debates on online social media, the dynamics leading to the emergence of these phenomena remain unclear. Here, we contribute to this endeavor by proposing novel metrics to single out the effect of the network dynamics from the opinion polarization. By using a Twitter data set collected during a controversial political debate in Brazil in 2016, we employ a temporal network approach to gauge the strength of the echo chamber effect over time. We define a measure of opinion coherence in the network showing how the echo chamber becomes weaker across the observed period. The analysis of the hashtags diffusion in the network shows that this is due to the increase of social interactions between users with opposite opinions. Finally, the analysis of the mutual entropy between the opinions expressed and received by the users permits to quantify the social contagion effect. We find empirical evidence that the polarization of the users and the dynamics of their interactions may evolve independently. Our findings may be of interest to the broad array of researchers studying the dynamics of echo chambers and polarization in online social networks.