A central Queensland railway line is closed after two stray cows caused a tilt train to derail.

Two train drivers were the only people on board when the derailment occurred about 35km north of Bundaberg at 6am (AEST) on Monday.

They both escaped injury but the cows died.

Rail crews are working to reopen the track.