Measurements of cross sections for events with charm and beauty jets in deep inelastic scattering at HERA are presented. Events with jets of transverse energy E_T^jet > 6 GeV and pseudorapidity -1.0 6 GeV^2 and inelasticity variable 0.07 6 GeV. The data were collected with the H1 detector in the years 2006 and 2007 corresponding to an integrated luminosity of 189 pb^-1. The numbers of charm and beauty jets are determined using variables reconstructed using the H1 vertex detector with which the impact parameters of the tracks to the primary vertex and the position of secondary vertices are measured. The measurements are compared with QCD predictions and with previous measurements where heavy flavours are identified using muons.Measurements...