The “Someone’s in the Kitchen with Dinah” section, with its noticeably different melody, is actually an older song that has been absorbed by “I’ve Been Working on the Railroad”. It was published as “Old Joe, or Somebody in the House with Dinah” in London in the 1830s or '40s, with music credited to J.H. Cave. “Dinah” was a generic name for a slave woman and, by extension, any woman of African-American descent.
This extra verse confirms what I figured the lyrics were about:
Some more history here: https://en.wikipedia.org/wiki/I've_Been_Working_on_the_Railroad
This extra verse confirms what I figured the lyrics were about:
I didn’t know about the Dinah thing, and the extant verse, TIL and thanks!
I thought I’d heard the name Dinah before, but I couldn’t place it.