No.
It's 100% illegal to wander around any railway yard, without the correct authorisation & permits.
As a visitor you are required sign in & to be accompanied by someone who's carries the correct certification namely a PTS certificate.
You'll also be required to wear PPE appropriate to the location, which may be a Hard Hat & HVV, the latter being compulsory.
If you're caught within the boundary fence, on any railway property, such as yards, sidings or even embankments/cuttings without due cause, namely in line with your duties, then you can & will be reported to BTP or Civil Police & possibly arrested for trespass.
So don't even think about entering any yard or siding without the necessary permissions, permits etc.
Whoever told you otherwise is telling you BIG PORKIES!