Depends on what type of train it is. A passenger aeroplane travels around 800 km/hr, a 'typical' train about 150-200.
However, the highest average speed of a commercial train is reached by the Fuxing, which goes 320 km/hr, enabling to go from Beijing to Nanjing (1,020 km) in 3.2 hours. The Shanghai maglev used to go faster, about 430 km/hr. So a train can certainly be faster than a plane on mid-long distances if we take pre-flight time into account.
An experimental Maglev, the L0 Series, managed to go 600 km/hr. At that speed, you're honestly directly competing with planes at long distances.