Title hopefuls Middlesex are facing a battle to avoid defeat after Derbyshire dominated day two of their LV= County Championship Division One clash.