If you went supersonic in a plane that has no pressurized cockpit, would you be completely deaf (because of flying faster-than-sound)? Would it be dangerous to the pilot even if he/she was in an enclosed cockpit, and if so, is this the reason why we still don't have supersonic maglev trains? Did anyone ever attempt or conduct a supersonic flight in a non-pressurized plane?
When you're in the cockpit, the sound you are hearing is vibrations of the skin and canopy/windows induced by the outside flow, transmitted through the air within the cabin to your ears. A very loud hiss/roar (even in a normal jet, if you speed up to near Vmo, say .85 M, the noise level in the flight deck gets unpleasantly loud. Go faster, and it's the same hiss/roar but the more energy being imparted means the sound level transmitted to your ears goes up).
When Chuck Yeager was going supersonic in the X-1, he could only tell he was supersonic was by the Mach Meter, not by the noise level.
If the cockpit was unpressurized, this doesn't really change because it's still just noise transmitted from vibrations of the skins/windows transmitted through air that is stationary relative to objects it's in contact with, so you're still just hearing a hiss/roar of the outer airstream passing by, supersonic flow or not. Just way louder, I'm sure, because of less sealing and insulation.
Any other sounds originating outside you would also hear to the extent that the sound waves from that sound impacted that skin and caused a change in the sound character being transmitted through the stationary air in the cockpit. If the wave was intense enough, you should hear a thump sound of some sort, whatever was the result the pressure wave of the sound origin changing the transmitted energy passing through the still air in the cockpit at the instant it reaches the fuselage.
The key part is that the air within the cockpit is not moving with any speed, so it will transmit any vibration from the skins, windows, engines, pumps, etc to your ears whether you are supersonic or not.
The sonic boom is left behind you as you are by definition going faster than the sound. It’s the people around you who are damaged by it. Hence why no supersonic flight over land - and news articles when it does happen for security reasons - and no supersonic vehicles in general.
I believe the Bell XS-1 was unpressurized. As John K points out, pressurization will not have an effect on sound levels in the cockpit.
In regards to your comments about supersonic trains, the energy consumption at low levels would be prohibitive in order to overcome exterior parasite drag and there are significant problems keeping and maintaining a vehicle on a track at those speeds. Attempts such as the Hyperloop in order to combat parasite drag by operating the vehicle inside of an evacuated tunnel are being experimented with, but in my opinion do not show a whole lot of promise, as the entire system would be cost prohibitive to operate, not to mention riddled with design difficulties. It has nothing to do with a pressurized cabin versus an unpressurized cabin.