Did you set the number of workers to 1 ? Logstash per default will process filters and outputs in parallel and does not guarantee event order.
You need to set pipeline.workers to 1 in your pipelines.yml for the pipeline you want to keep the order.
But even doing this, I'm not sure that the order is guaranteed in Kibana since you may have events with the same @timestamp value and they may be shown out of order.