The setPosition and setVelocity can be called on MuJoCo bodies that have a "free-joint". However, you should also be able to call these methods for bodies that have three slider joints:
<joint name="ball_x" type="slide" axis="1 0 0"/>
<joint name="ball_y" type="slide" axis="0 1 0"/>
<joint name="ball_z" type="slide" axis="0 0 1"/>
since this effectively enables translation-only simulation.