Standard refraction traveltime tomography solutions for statics corrections do not allow irregular parameterization of the model, simultaneous inversion of velocity and depth parameters, or selection of the types of first arrival times to be inverted. An algorithm widely used to study and build crustal structure and velocity models from wide-angle seismic data was applied for the modeling and inversion of the velocity and structure of near-surface layers. This flexible tomographic solution allows the definition of complex heterogeneous models through trapezoids of irregular size to parameterize the model, and it allows the simultaneous inversion of head-waves and turning-rays, which can be defined independently for each layer interface. This work presents a study of the application of this flexible tomographic inversion algorithm to obtain the velocity model and geological structure of the near-surface weathering zone. The proposed workflow was evaluated on two synthetic models built with real topography, and geophysical and geological information was obtained from real cases. The first is a model with three layers with constant velocities, and the second is a model with two heterogeneous layers with lateral and vertical velocity variations in the weathering zone. For the second model, turning-rays crossing the weathering layer are considered in the tomography process. Synthetic seismic data were generated, and an initial model was built using traditional seismic refraction interpretation methods. Thereafter, inversion was performed using a 2D ray-based tomography algorithm to minimize first-arrival traveltime misfits by inverting the seismic velocities and the vertical position of the refractors. It was verified that the proposed workflow obtained the smallest relative errors in most parameters of the velocity model and consequently, for the statics corrections.