Fyi, that sentence was from an actual book so 車内 is definitely fine, but no I can’t really pinpoint why 電車の中 feels weird. Honestly maybe it’s describing the entire space inside of it with 暑い. Like usually I feel like it’s in the train rather than describing the entire train car maybe. I would have to check but I feel like it’s used less as the subject that’s being described in things I’ve seen.
And to your other point, 車内 is actually the more common one by a decent margin when it comes to books from what I’ve checked. So it definitely has uses outside of signs.