If the piston were truly massless, at the slightest touch it would move away at the speed of light.
But that's not what they mean when they say "massless"; what they really want is for you to ignore any effects that the piston's mass would introduce. Otherwise it would unnecessarily complicate the situation without adding to your understanding of the simple principles that they are trying to teach.
You will similarly encounter frictionless surfaces, massless pulleys and ropes, perfectly incompressible solids, etc. None of them exist in reality, they are just a way of simplifying the situation so that you can concentrate on the details that are important.
This particular question doesn't supply any additional details, but presumably the piston causes some other object to move, and that object has the mass that you would use in your calculations.