Rolling stock is everything that runs on the rails: locomotives, which pull trains, freight wagons, passenger coaches and metro trains. In India, the main buyers are Indian Railways and the metro companies of each city. Indian Railways builds most of its coaches and locomotives in its own factories. It also buys some locomotives from makers such as Alstom and Siemens. Metro companies buy their trains from makers. A train is bought once and used for decades.
The kinds differ in how they move. A locomotive is an engine that pulls other vehicles. A wagon carries goods and a coach carries passengers, and neither has an engine of its own. A metro train or a suburban electric train is different: its motors are fitted under its own coaches, so the whole train drives itself and no locomotive is needed.
A modern train is no longer only steel and wheels. A locomotive has computers that control its motors and its brakes, and a metro train has computers that control its doors, its air conditioning and its speed. Engineers write the software on these computers. It must be tested thoroughly, because a fault in a braking computer can hurt passengers, and a train with an unproven fault cannot be allowed to run. That testing is part of safety certification.
The train is also connected to other systems. It receives permission to move from the signalling system. It is stopped by automatic train protection if the driver passes a red signal. Sensors on its wheels, brakes and motors send readings to railway condition monitoring, which predicts which part will fail next. Some metro trains run with no driver at all, under CBTC (communication-based train control).
Here is a typical case. Say a metro company buys 30 trains for a new line. It chooses the maker through a government tender. For the next 30 years, the maker, or a company it appoints, keeps supplying spare parts and servicing for those trains. This is service after the sale, and over the years it can earn the maker more than the first sale.
Rolling stock is the train itself. The signals, the track and the power supply that serve it are separate products, described under railway technology.