Confusion in selecting number of state variables
why in case of mass elements (or mechanical systems in 2nd example) state variables are taken as position and velocity rather than only position?

I think if you read the part of the book around 'mechanical systems', you'll find that when they have two state variables, they're doing the sums for a mass-spring system. A mass and a force is fairly uninteresting, acceleration of a mass due to gravity for instance is just a quadratic in time.
With a mass and a spring, there are two energy storage elements, and it's convenient to use position for the spring potential energy and velocity for the mass kinetic energy.