Evolution of cosmic filaments and of their galaxy population from MHD cosmological simulations