Kinetic theory of a longitudinally expanding system of scalar particles