Goal. Starting with the full-scale invasion on February 24, 2022, the aggressor country began to make it difficult to access major ports in southern Ukraine, limiting the importation, transportation, and export of grain. This forced shippers to look for alternative routes for transporting grain to foreign seaports. A large share of the transportation of grain cargo fell on railway transport and on western terminals, which caused long queues at crossing points. Restrictions also affected the capacity of internal railway lines. To restore the transportation of agricultural goods and increase the efficiency of the organization of grain transportation, it is necessary to conduct a study of the logistics costs of road and rail transportation, considering such factors as the type of shipment, the volume of cargo, time costs, the cost of transportation, and the capacity of border crossings and terminals. Method. The research was carried out based on statistical analysis, methods of operational work for calculating the norms of mass and length of route trains, a comprehensive analysis of logistics costs when transporting various types of shipments by rail and road modes of transport, considering the technical equipment of terminals and the capacity of crossing points, the train formation plan (TFP). The results. Based on calculations, the conditional lengths of route trains are determined, with their further bringing them to the current PFP on the railways of Ukraine; the cost of delivery of grain cargoes when transported by rail was calculated for various types of shipments, and a comparison was made with road transport; terms of cargo delivery, main advantages and disadvantages of each type of transportation are determined; analysed and selected the best method of transportation of agricultural cargo, taking into account the weight of the cargo being transported, the time spent on transportation along the tracking routes; a comparison of financial costs per ton of cargo was made; proposed options for increasing the throughput of border railway stations. The work also identifies the busiest terminals that carry out a significant share of cargo processing at border railway stations with a relatively large capacity and technical support for the transhipment of grain depending on the types of shipments, namely: railway stations and their transitions - Chop - Chierna-nad-Tysoy, Mostyska II-Medyka and Izov - Hrebushiv. Practical significance. The obtained results can be applied in decision-making systems for shippers, which will help in choosing the optimal route and type of rolling stock for cargo transportation. The rational choice of types of shipments and transfer stations makes it possible to use technical means for cargo transhipment as effectively as possible, to reduce the waiting time of wagons at border stations while waiting for technological operations and to reduce the time for these operations, to reduce the total costs of transporting agricultural goods. Options for increasing the throughput capacity of border stations will make it possible to speed up the delivery of cargo by speeding up the execution of mandatory operations performed at transhipment points or by removing part of such operations altogether.