Wettability-mediated dynamics of two-phase flow in microfluidic T-junction