The real-time traffic control of railway networks imposes safety constraints and authorizes movements of trains. This work deals with it by focusing on conflict and deadlock avoidance problems. A place-timed Petri net model is developed for a railway network. Based on it, a conflict avoidance method is presented to ensure that safety principles in railway networks are respected. Also, a polynomial deadlock avoidance policy based on the Banker’s algorithm is proposed. It authorizes the movement of trains between block sections and stations. The proposed conflict avoidance method and deadlock avoidance policy together ensure a railway network to be conflict-free and deadlock-free. Experimental results show that they are effective and efficient.