Error in model compiling using RJAGS package

The problem is that the weekday variable from the RailTrail data is logical, with values {FALSE, TRUE} which have numerical values of 0 and 1, respectively. You need to turn those into values 1 and 2. This should do the trick:

poisson_jags <- jags.model(textConnection(poisson_model), 
                           data = list(Y = RailTrail$volume, 
                                       X = as.numeric(RailTrail$weekday)+1, 
                                       Z = RailTrail$hightemp), 
                           inits = list(.RNG.name = "base::Wichmann-Hill", 
                                        .RNG.seed = 10))