Carol, I don't know about your specific situation but here is some background. In the 1880's to entice companies into building a trans-continental railroad across the northern US, the USA gave the Northern Pacific Railroad (NPRR) every other section of land (and minerals) for 40 miles on either side of where they built their tracks.
To recover the cost of building the railroad, the NPRR then sold much of this land to families for homesteads. When the railroad sold the land they often reserved all the minerals, though on occasion they also sold the minerals (except for the coal) along with the surface to the families. What you describes sounds like a dispute on this issue.
However, looking at the US Patents www.GLOrecords.blm.gov for T2N, R40E, Section 12 it shows the land never went to the railroad. It was homesteaded by a man named Clarence V. Chilberg. The E 1/2 of that section was patented 1-25-1922 and the USA reserved (kept) all coal. The W 1/2 half was patented on 4-7-1926 and the USA reserved (kept) ALL MINERALS. So the heirs, or successors, of Mr. Chilberg would own minerals (except coal) only on the east half of Section 12.
If you had an issue with the railroad claiming minerals it must have been on another piece of ground. To determine who (you or them) owns minerals there, research the deeds recorded for that property. There will be a patent from the USA to the railroad. Then the next deed, from the railroad to an individual, is where you will probably learn what, if any, minerals were conveyed with the land. Hope this helps. Good Luck.