Linear Representation of Transversal Matroids and Gammoids parameterized by rank