In the United States, the railway tracks are owned by the railroad companies. The federal government gave land grants to the railroads in the 1800s. The government does not own or operate the railway system. Even the freight railroad companies are privately owned. The freight cars themselves are mostly owned by the shippers and car companies (whose cars are transported all over the countries on freight trains).
The United States freight train system carries the most freight in the world. In Europe, the railway is owned by the government. The European train system is mostly for passengers. In fact, many more people use the trains in Europe because they can compete with airlines. They are also more efficient than driving a car. In the United States, most of the passenger trains use the tracks owned by the freight companies. For passenger trains to become a more popular way to travel in the U.S., the service would have to improve. That could be a big investment for the government, or private companies.