You can not design a sign that keeps people off, you need something physical that makes it impossible to get on the rails, just like in cities like Singapore, where a gate is placed in front of the rails, which only opens when the tram opens train opened the doors so people can enter.
You can lay something like a printed line 1 meter in front of the rails with eye-catching colors like yellow / red / pink etc. on the floor and insert a text like "Watch your step" etc. in between.
Bonus Points If you use not just a printed line, but a physical line that has a different texture / height than the ground, users will automatically be aware that they are close to the rails as they enter the rails.
I found an example on google that shows you what I mean